My strategy runs on bid-ask data on minute bars. Every tick I calculate my signal based on bid-ask midprice.
On the first bar of a minute, either the bid or ask will update first and I will get a midprice calculated on a current bar and a bar from last minute which is obviously very off from current market.
I would like to run my strategy only when the last bar of that specific minute is updated. How can I do this?
I have thought about counting the number of updates for a specific timestamp and only allowing to go further when that number equals the number of bars I have added, but can I have a guarantee that if I have subscribed to bid-ask, I will get OnBarUpdate fire for each bar at each minute?
Also, to ensure realistic delays, if I submit my orders on the 'trades bar', can I submit the order at any time or should I wait for the 'trades bar' to have updated for that specific minute?

Comment