I'm trying to sort out updates to the inside Bid and Ask in OnMarketData vs OnMarketDepth.
Using your SampleMarketDepth as a basis, I added a Print statement whenever the Position 0 Ask row is updated.
I also added the OnMarketData method, with a Print statement whenever the Ask is updated.
Generally the updates appear in strict sequence, first OnMarketDepth and then OnMarketData.
Quite often, however, some updates are processed by OnMarketDepth but are skipped by OnMarketData (see image 1).
On the other hand, when the price is updated, the update appears to be first processed by OnMarketData and then by OnMarketDepth (see image 2), before reverting to the 'normal' sequence.
Could you clarify what is going on?
Thanks
Comment