lock (e.Instrument.SyncMarketDepth)
around each event processed :
The data collected is then used in OnBarUpdate which processes every tick.
Unlike OnMarketData and OnBarUpdate where there is some synchronicity of events between the two as illustrated in the help pages;
whereas onMarketDepth() events are asynchronous to onBarUpdate (at least i am presuming this as there is nothing i can see in the help pages)
I am resetting some counters in the code and i tried the following :
testing for IsFirstTickOfBar in both onmarketdepth() and in onbarupdate() and resetting them within that - i have created versions to do it :
1. in both onmarketdepth() and onbarupdate()
2. only in onmarketdepth()
3. only in onbarupdate()
the question is if there is any recommendation of where to do this reset cleanly and accurately on the first tick of a new bar ; as both onmarketdepth() and onbarupdate() will then update and use the data for each new bar.
I am seeing some difference in a visual tool i created so clearly the location of the reset has some implications but im not clear which is the most accurate.
Is this clear and any thoughts ? If you need more outline let me know but the above is the gist and hopefully covers the context
thanks
Comment