I'm having an issue running my script on a backtest dataset. I'm not sure if there is an issue with the script (most likely) or with my downloaded data.
I'd like to run a year worth of backtest to analyze the data and I'm just not able to run the script on MES 06-22 (the month of May and the month of July). The script halts with the following message:
Strategy 'MyCoolStrategy233': Error on calling 'OnBarUpdate' method on bar 211: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
I have worked with Multi-timeframe strategies before and I was required to add the following as pretty much the start of my script (which I have done)
if (CurrentBars[0] < 201) { return; }
I don't even know a starting point to address this. Hoping you have something that can point me in the right direction.
Thanks!
Comment