softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

reqTickByTickData #89

Closed bondtrade closed 3 years ago

bondtrade commented 4 years ago

Hi Abel, Do you support reqTickByTickData data streaming method? It appears reqMktData has 250 millisecond latency so I'm wondering if reqTickByTickData is faster?

softwarespartan commented 4 years ago

yes, TickByTick is faster but 99% of users can not process MktData fast/efficiently enough even with the 250ms aggregation that IB is doing. Already get many questions about trying to process market data, I worry adding in tick data is just going to cause more problems than it solves. If you guys really want it, I'll go in and add it. Not likely that Matlab event thread itself can process this much data.

If want process tick data, then should really be writing native C++ codes. Unless you really know what you're doing in Matlab, the 5 second bars from reqRealTimeBar is about the realistic maximum if doing live trading from within Matlab.

Despair2000 commented 4 years ago

As I already mentioned in another thread I'd think it'd me a valuable addition even if it is not really possible to make matlab act upon it but for aggregation to other bars. Just to get a finer granularity of the order flow. But for the moment I can also live without it but maybe a nice think to do i quarantine ;-)

P.S.: I was laughing loud over you "jedi matlab coder" in the other thread. :-D

softwarespartan commented 4 years ago

@bondtrade @Despair2000 tick-by-tick has been added. Let me know how it goes and if find any bugs. New events in IB4m are

TWS.Events.TICKBYTICK_ALLLAST TWS.Events.TICKBYTICK_BIDASK TWS.Events.TICKBYTICK_MIDPOINT

See docs: https://interactivebrokers.github.io/tws-api/tick_data.html

Note that nonzero numberOfTicks is not currently supported in IB4m. That is, historicalTicksLast, historicalTicksBidAsk, or historicalTicks callbacks have not been implemented.

bondtrade commented 4 years ago

Great. Thanks again. Much appreciated!