My question is given the following description is it sufficient to use OnBarUpdate and CalculateOnBarClose = false or do I need to use OnMarketData somehow? Are there any known issues I should expect?
1) Given an indicator with a lookback of N bars.
The indicator measures the magnitude of a trend,
magnitude = numerator / denominator - 1
2) I need the numerator to be real-time data and the denominator to be the close of a bar n bars ago (where n <= N).
3) Then, assuming we are using volume bars, value = 1000,
I need a new bar to be formed in real-time for every 1000 contracts (volume) to make sure that the bars in the lookback are updating with the arrival of new data.
Comment