I do it by analogy with the Manual
private OrderFlowCumulativeDelta cumulativeDelta; private OrderFlowCumulativeDelta cumulativeDelta2; private CumulativeDeltaType deltaType=CumulativeDeltaType.BidAsk; ... else if (State == State.Configure) { AddDataSeries(Data.BarsPeriodType.Tick, 1); AddDataSeries("NQ 12-21",BarsPeriodType.Minute, 5); AddDataSeries("NQ 12-21",Data.BarsPeriodType.Tick, 1); } else if (State == State.DataLoaded) { cumulativeDelta = OrderFlowCumulativeDelta(deltaType, CumulativeDeltaPeriod.Bar, 0); cumulativeDelta2 = OrderFlowCumulativeDelta(BarsArray[2],deltaType, CumulativeDeltaPeriod.Bar, 0); } ... protected override void OnBarUpdate() { if (BarsInProgress == 1) { cumulativeDelta.Update(cumulativeDelta.BarsArray[1].Count - 1, 1); } else if (BarsInProgress == 3) { cumulativeDelta2.Update(cumulativeDelta2.BarsArray[3].Count - 1, 1); } }
Indicator 'DeltaTest': Error on calling 'OnBarUpdate' method on bar -1: Index was outside the bounds of the array.
Comment