is there here in Ninjatrader away to solve such problem?
I am building a strategy, but I am facing a problem while compiling the code. I am reciving the message like: " Error on calling 'OnBarUpdate' method on bar 14: 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 the following code:
if(CurrentBar < 14) return;
for(int i = 14; i >= 0; i--)
{
double myRsi = RSI(14, 3)[i+8];
}
In my code, when i = 14,
myRsi = RSI(14, 3)[14+8]
what ist already beyong the 14 I have in my loop.
How could I solve this problem since I am frequently encountering such problems in my codes? Which condition could be suitable in this case so that I could have the value of myRsi at position 14+8 for example?

Comment