I'm getting this error on my strategy:
"You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart."
To avoid it I wrote this code on the beginning of the OnBarUpdate():
if (CurrentBar < 10)
return;
But the error remains. It's a multiinstrument strategy. Perhaps I should use CurrentBars[0] ?
thanks
Comment