As I am trying to retrieve tick data from IB through python API. I encountered a 'definition' problem. As far as I know, IB does not offer real tick by tick data, but a 250ms snap-shot(for US stock and futures etc.). So, the 'tick' price is a mini bar having its own open, high, low, close prices.
The tick I get from ib_insync looks like this:
While I tried several options at a short time, it gives price quote with a larger gap than I expected:
data.last = 4134.75;
data.close=4130.5;
data.marketPrice()=4135.25;
maybe, when press the button, 1 second eclipsed and price changed. but, could it be as large as 5 points in a second ?
The tick I get from ib_insync looks like this:
Code:
Ticker(contract=ContFuture(conId=497954518, symbol='MES', lastTradeDateOrContractMonth='20220916', multiplier='5', exchange='GLOBEX', currency='USD', localSymbol='MESU2', tradingClass='MES'), time=datetime.datetime(2022, 8, 24, 11, 46, 21, 340415, tzinfo=datetime.timezone.utc), bid=4134.0, bidSize=30, ask=4134.25, askSize=7, last=4134.0, lastSize=1, prevBid=4134.25, prevBidSize=18, prevAsk=4134.5, prevAskSize=15, prevLast=4134.25, prevLastSize=2, volume=117929, open=4129.0, high=4136.75, low=4110.5, close=4130.5, halted=0.0, ticks=[TickData(time=datetime.datetime(2022, 8, 24, 11, 46, 21, 340415, tzinfo=datetime.timezone.utc), tickType=4, price=4134.0, size=1), TickData(time=datetime.datetime(2022, 8, 24, 11, 46, 21, 340415, tzinfo=datetime.timezone.utc), tickType=5, price=4134.0, size=1)])
While I tried several options at a short time, it gives price quote with a larger gap than I expected:
data.last = 4134.75;
data.close=4130.5;
data.marketPrice()=4135.25;
maybe, when press the button, 1 second eclipsed and price changed. but, could it be as large as 5 points in a second ?