if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Day, 1); // add secondary day bar
}
if (State == State.Historical)
{
Print(ATR(BarsArray[1], 14)[0]);
}
Exception message:
"accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart."
How do I achieve what I want just once on strategy initialization?

Comment