IB API order submission question

Discussion in 'Programming' started by aripplet, Apr 3, 2012.

  1. aripplet



    I am writing a forex scalping program with IB POSIX C++ API,

    there is one question:

    I need to submit one parent order and attach one trailing stop order and one profit taking order.

    parent order is market order as I don't want to miss any opportunity, filling as fast as need. but trailing order can't be attached to market parent order.

    if I attach a stop order first, I am not able to change it to TRAIL type later.

    So what kind of solution you use?
    1. submit parent order with limit order, you could put limit price higher than market price (for buy) to simulate a market order, but in this case I have to track the bid/ask as fast as I could, I don't even know IB is capable of it (no real tick price and latency between my computer and their servers).

    2. submit parent order with MKT type, no child order, put a trailing order afterwards?

    3. manually implement a TRAIL order by modifying stop price for STP order attached whenever necessary.

    Thanks a lot for your help!
  2. I hope someone answers your question, but I do have a question for you. You do understand that IB charges a $5 commission ($2.50 per transaction) for each trade, in addition to the 0.5 pip spread. Isn't that a bit too high for a scalping strategy to work?
  3. Hi.

    I am developing a system to measure some stock-price performance. And i am having trouble in some calculation.
    Generally I try to get the price of a ticker every 10 mins. since a news or this ticker has been published. For example: assuming that cell a1 indicate the published time of a news message and cell b1 indicate the stock price at the news published, c1 will be the price of the ticker after 20 mins. Now the input for cell b1, c1 is the IB api stock price counter. Doing that with some excel calculation with if function does not work, it is not possible to save the price on cell b1, c1.

    Does anyone know how I can save the data in a cell every 10 mins.?

    Thanks a lot,
  4. aripplet


    with 10/10 pips tp/sl, I think 0.5pip + $5/$10($10 per pip for 100K), which is 1 pip cost, it's still possible to do it.