When receiving financial tick data through Interactive Brokers' API methods tickPrice
or tickSize
the data will have the following parameters
- tickerId (symbol)
- field (1=bid, 2=ask, 4=last, 6=high, 7=low, 9=close)
- price
- canAutoExecute
From any other feed I would expect a tick to give me
- tickerId (symbol)
- bid
- ask
- bid size
- ask size
So my question is: Should I keep a dictionary with tickerId as key and a struct as value containing the above five properties, such that each time a tick event is raised I would update the struct's respective property and send the whole struct to my database as a tick? Ideally my tick database would look something like this
Date Time Symbol Side Price Quantity
2012-10-31 13:51:13.784 AAPL Bid 25.81 15007
2012-10-31 13:51:14.615 AAPL Bid 25.82 10
2012-10-31 13:51:14.633 AAPL Bid 25.81 13623
2012-10-31 13:51:14.684 AAPL Ask 25.82 2500
2012-10-31 13:52:09.168 AAPL Bid 25.80 12223
From the IB API documentation: This method is called when the market data changes. Does this mean that if e.g. bid price is updated, the other properties will remain the same?
tickPrice
ortickSize
return timestamped information. – BonetickPrice
callback is indeed useless without timestamps. The latest API hastickByTickAllLast
andtickByTickBidAsk
which have timestamps. – Metallo