When receiving financial tick data through Interactive Brokers' API methods tickPrice
or tickSize
the data will have the following parameters
From any other feed I would expect a tick to give me
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?
You are right. Whenever a certain property changes, a new tick event will be triggered. Your design of using a struct to save the tick snapshot is one of the standard approaches.
In other word, IB's API will send back each aggregated tick as they arrive. However, these ticks are not real ticks, as they are only 0.2 - 0.3 second snapshots. If you you are dealing with HFT, then these data may bot be reliable for order book simulation. However, if you are just performing basic data analysis, then their quality is acceptable.
Their high, low and close price in this case may not be useful, as standard order book will not contain high, low close information. I will usually discard them. Bid size and ask size are also not reliable in this case, since they are just synthetic ticks.
Hope my answer helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With