I need to calculate with OFCumulativeDelta for 2 instruments in an indicator that I run on a 15min chart with "Instrument1".
So I add in State.Configure
AddDataSeries("Instr1", BarsPeriodType.Tick, 1);
AddDataSeries("Instr2", BarsPeriodType.Tick, 1);
AddDataSeries("Instr2", BarsPeriodType.Minute, 15);
and in OnBarUpdate I have
if (BarsInProgress == 1) // This is the code example from the help guide, it runs when the 1 tick series calls OnBarUpdate and is needed to sync the values.
{
OrderFlowCumulativeDelta1.Update(OrderFlowCumulati veDelta1.BarsArray[1].Count - 1, 1); // note that I changed the name to what the strategy builder created.
}
if (BarsInProgress == 2) // This is the code example from the help guide, it runs when the 1 tick series calls OnBarUpdate and is needed to sync the values.
{
OrderFlowCumulativeDelta2.Update(OrderFlowCumulati veDelta2.BarsArray[2].Count - 1, 1); // note that I changed the name to what the strategy builder created.
}
But when adding the indicator to a chart I get in log tab an error-message
| 10.08.2021 15:45:27 | Default | Indicator '': Error on calling 'OnBarUpdate' method on bar 1658: Index was outside the bounds of the array. |
Thank you!
Tony

Comment