coded. The Strategy normally runs on a 1 minute chart. I want to calculate the 10 day ATR so I have the following coded near the top of the OnBarUpdate() method:
if (BarsInProgress == 1)
{
Index = CurrentBars[1] - Bars.GetBar(Time[0].Date.AddHours(21));
dailyATR = ATR(BarsArray[1],10)[Index];
}
This works fine except for the first day that I want to start processing trades. Since the BarsArray[0] processes before the BarsArray[1] bars the ATR doesn't get calculated on the first day.
What would be a good way to correct this?

Comment