I trade by ip api, does anyone knows the delay time of bid/ask data from tickPrice and updateMktDepth. It seems tickPrice is snapShot data made by ib every 0.5 or 0.25 second. How about the data from updateMktDepth? Can it be looked as real time data, or it's also snapshot made by ib every 0.5 or 0.25 second? When the market is very volatile, can I send buy order with price as high as the ASK data from updateMktDepth and make sure the order can be filled? Or anything else I can do to make sure the order can be filled when the market becomes very volatile?
IB data subscriptions update about every 300 milliseconds, except for a couple stock index futures which update about every 100 msec. I hear a lot of complaints about sampled data, but what the complainers seem not to realize is that when trading via the Internet, you can have complete data (all tics) or timely data (no lag), but not both. Personally, I prefer timely data with minimal lag, especially during busy times. If you are trading stocks, you should be aware that there are multiple venues, and the prices you are seeing may be hard to connect with. Most stock orders can be routed to more than one place. You should also be familiar with the various order types and whether they are native or simulated where you are trading. For example, market orders are simulated on Globex and may not fill as expected. You are often better off using native orders.
Years ago I have learned that limit orders have higher priority than market orders in the queue. Therefore when I mean market order I fire limit order above Ask or below Bid (not too far so it is accepted) to assure execution and have my limit protection too. I do not know how orders are queued now in this fragmented market because I did not look into this recently. IB will give you update about 3x per second or more frequently for some futures markets. It is irrelevant to you because by the time you (your computer) see the price it is history and market price is somewhere else.
One more thing to clarify: if your limit order crosses NBBO (national best bid offer) then it should be filled at the current NBBO and not your specified limit.
"Should" is the operating word. There will be situations where your LMT order won't get filled for stocks even when price appears to got way passed it. Thank the gazillion US stock exchanges for that.
In 18/otc/2012, the price of google dropped from 750 to under 700 in several minutes, if I want to sell my shares at the end of first minute after the price began dropping, do you think your strategy workable to people who trade by IB api?
Depends on what and how your algo trades. Even so the iB data has a ~ 0.x secs lag and iB execution lags ~ 0.x secs, I have a fill rate of >93% for FOK/IOC LMT equity orders with iB quotes.