protected override void OnBarUpdate() {
if(CurrentBar > 14)
return;
var count = ATR(14).Count;
Print(string.Format("ATR(14).Count: {0}", count));
for (int i = 0; i < count; i++) {
Print(string.Format("ATR[{0}]: {1}", i, ATR(14)[i]));
}
}
ATR(14).Count: 1870
ATR[0]: 3.54136297376093
ATR[1]: 3.56377551020408
ATR[2]: 3.60714285714286
ATR[3]: 3.55769230769231
ATR[4]: 3.58333333333333
ATR[5]: 3.68181818181818
ATR[6]: 3.85
ATR[7]: 3.91666666666667
ATR[8]: 4.09375
ATR[9]: 4.28571428571429
ATR[10]: 4.20833333333333
ATR[11]: 4.2
ATR[12]: 4.625
ATR[13]: 4.83333333333333
ATR[14]: 5.625
ATR[15]: 6.25
Error on calling 'OnBarUpdate' method on bar 15: 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.
Comment