I'm using NT8. I need bid, ask, depth, so I'm using OnMarketData. I'm counting ticks/volume per bar.
Like many others, I try to reset those volume counters in OnBarUpdate using IsFirstTickOfBar when a new bar is formed. However, due to the threading etc, I'm not sure if I am loosing ticks and I think this is incorrect. You can't use the isfirsttickofbar in onMarketData, so I wonder, what is the best way to detect a new bar and reset your counters in a way that you can be sure all the ticks are accounted for if you are using OnMarketData.
Assuming that onmarketdata runs in a single thread and 2 or more of them do not run at the same time, should I use 'CurrentBar' to detect these changes and reset my counters within OnMarketData itself?
A lot of people (including me) seem a little confused by this, so helpfully this helps others too in the way I tried to phrase it.
Thank.
Comment