I am having issues when working with Volumetric Bars (I have a lifetime NT license) with some instruments and I cannot figure out why.
In my strategy I am adding a volumetric data series to use some order flow information, however there seems to be a mismatch between the number of bars retrieved by the main data series and the volumetric one.
As you can see in the screenshot below, BarsArray[0] is way larger than BarsArray[1] so when I try to reference a bar from BarsArray[1] using the CurrentBar that called OnBarUpdate for BarsInProgress == 1, it throws the error below.
The way I am adding the volumetric bars is as follows on the OnStateChange method (it happens the same if I hardcode the instrument name, base period type and value)
else if (State == State.Configure) { AddVolumetric(Instrument.FullName, this.BarsPeriod.BaseBarsPeriodType, this.BarsPeriod.Value, VolumetricDeltaType.BidAsk, 1); }
And the way I try to get the volumetric information is as follows in OnBarUpdate method:
if (BarsInProgress == 1) { VolumetricBarsType volumetricBarsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType; VolumetricData volumetricBar = volumetricBarsType.Volumes[CurrentBar]; ...... }
I have all the historical data required for the time range I am backtesting, and I cannot find why the two data series are different in size
The instrument is FDAX 03-23 backtesting for the whole 2022 year
Any ideas?
Comment