Questions regarding IB API

To answer your question though it seems I have no other choice but to wait a sufficient amount of time until I receive all updates, a penalty I prefer to publishing an incomplete or incorrect tick.

Since they aggregate changes for 250ms (stocks, futures) I need to figure out what amount of time I can spare to wait until I publish a tick (even if it could be incorrect).
But I will try to work around this I guess.

Assuming you are monitoring the Market data for multiple symbols, you could also publish a tick whenever the symbol changes. You would still need a time limit, but during busy periods that time limit should rarely be reached.
 
This whole problem could of been solved easily by IB by sending all aggregated changes in one message instead of splitting to a message per field.

This is the way NxCore and IQFeed send updates.

I don't know if the exchange itself sends atomic updates or not.

The exchanges send atomic updates. But that does not mean that a field can't be missing, such as a bid with no ask.
 
Assuming you are monitoring the Market data for multiple symbols, you could also publish a tick whenever the symbol changes. You would still need a time limit, but during busy periods that time limit should rarely be reached.
Sounds interesting.
I can use this if the gateway receives updates through one socket only.
If updates are sent through multiple sockets concurrently then the following is possible:

MSFT price --> MSFT volume --> MSFT bid --> MSFT bid size
________GOOG price --> GOOG volume
 
Use socket level instead of C#. C# wrapper is a buggy and poor implemented.

Your comment seemed interesting to me. I've just programmed in C# in certain platforms, and eventually, I've tested the IB-API in C#. However having in mind that you and many others say it is buggy and you suggest: use socket level, I researched but it seems complicated, it is not even documented, a pity for non CS like us.

What about Fix protocol ?

Thanks
 
Last edited:
To directly answer your questions:
4) All tick changes are not sent to the gateway. It seems to be a time slice, though I have never measure the frequency. I also subscribe to NxCore and IQFeed, and about 60% of the time the IB API quote precedes the NxCore quote, and 90% of the time IB precedes IQFeed.

@DaveV Interesting, thanks for sharing. Can I ask where your box is located? If you're in the NY/NJ area, I suppose IB ticks arriving first makes sense since I believe they disseminate from NY4 while IQFeed is in Nebraska and NxCore is out of either AWS East or Chicago (if memory serves).
 
My box is located in Milford, CT. I once read that the IB data center is located in Stamford, CT which if true, is about 20 miles from my box.
 
My box is located in Milford, CT. I once read that the IB data center is located in Stamford, CT which if true, is about 20 miles from my box.
Makes sense, thanks. I know that they have a presence in NY4 because I've talked to them about a cross connect before, but (like you) I've also heard they are in CT. I couldn't say for sure which is used for market data - possibly both.
 
Thanks for the advises guys,

Making some progress here and am currently testing bracket orders on the paper account.
Not sure if I have done everything correctly though since I am getting presubmitted status on some of the child orders.

Here is the bracket sell order I have sent to the gateway: sell 100 MSFT -> 82.83 LMT, 81.6 STP:

21:18:12:130 <- 3-45-3-0-MSFT-STK--0---ISLAND-------Sell-100-LMT-82.83-0-DAY---O-0--0-0-0-0-0-0-0-0--0--------0---1-0---0---0-0--0------0-----0-----------0---0-0---0--0-0-0-0--1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-0-----
21:18:12:131 <- 3-45-4-0-MSFT-STK--0---ISLAND-------Sell-100-LMT-82.83-0-DAY---O-0--0-3-0-0-0-0-0-0--0--------0---1-0---0---0-0--0------0-----0-----------0---0-0---0--0-0-0-0--1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-0-----
21:18:12:131 <- 3-45-5-0-MSFT-STK--0---ISLAND-------Sell-100-STP-0-81.6-DAY---O-0--1-3-0-0-0-0-0-0--0--------0---1-0---0---0-0--0------0-----0-----------0---0-0---0--0-0-0-0--1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-1.79769313486232E+308-0-----

Here is the response:
21:18:12:716 -> --ó5-34-4-272093-MSFT-STK--0-?--ISLAND-USD-MSFT-NMS-SELL-100-LMT-82.83-0.0-DAY-1351961740-DU768066-O-0--1238104769-1351961741-0-0-0--1351961741.0/DU768066/100----------0---1-0-------0-0-0--3-0-0--3-0--0-None--0----?-0-0--0-0------0-0-0-----0--IB-0-0--0-0-PreSubmitted-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308------0-0-0-None-1.7976931348623157E308-83.83-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308-0----1.7976931348623157E308----B3-4-PreSubmitted-0-100-0-1351961741-3-0-1238104769-child,locate-0-
21:18:13:067 -> --ã5-34-5-272093-MSFT-STK--0-?--ISLAND-USD-MSFT-NMS-SELL-100-STP-0.0-81.6-DAY-1351961740-DU768066-O-0--1238104769-1351961742-0-0-0--1351961742.0/DU768066/100----------0---1-0-------0-0-0--3-0-0--3-0--0-None--0----?-0-0--0-0------0-0-0-----0--IB-0-0--0-0-PreSubmitted-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308------0-0-0-None-1.7976931348623157E308-81.6-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308-Infinity-0----1.7976931348623157E308----J3-5-PreSubmitted-0-100-0-1351961742-3-0-1238104769-child,locate,trigger-0-
21:18:13:074 -> --æ5-34-3-272093-MSFT-STK--0-?--ISLAND-USD-MSFT-NMS-SELL-100-LMT-82.83-0.0-DAY--DU768066-O-0--1238104769-1351961740-0-0-0--1351961740.0/DU768066/100----------0---1-0-------0-0-0--3-0-0--0-0--0-None--0----?-0-0--0-0------0-0-0-----0--IB-0-0--0-0-Submitted-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308------0-0-0-None-1.7976931348623157E308-83.83-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308-1.7976931348623157E308-0----1.7976931348623157E308----33-3-Submitted-0-100-0-1351961740-0-0-1238104769--0-

Notice that the first two children are presubmitted, and the parent order in the end is submitted.
This looks somewhat odd to me, does someone has any idea if this is valid and if not what am I doing wrong?
Also why does the first child order has a "child,locate" and the second "child,locate,trigger"?
 
Stop orders have trigger type - last, double last, bid, ask etc. Limit orders don't.

PreSubmitted only because they activate once the initial entry is filled.
 
Stop orders have trigger type - last, double last, bid, ask etc. Limit orders don't.

PreSubmitted only because they activate once the initial entry is filled.
Thanks, is the initial entry the parent order? or I am off the mark here.
 
Back
Top