I want to loop through all the bars in OBU to produce multiple CMA's.
int allbar = 0; for(int i = ChartBars.FromIndex; i < ChartBars.ToIndex; i++) { allbar = i; } if (CurrentBar < (allbar-Period)) return;
That would be the reason why i get this error message:
Indicator 'CMA01': Error on calling 'OnBarUpdate' method on bar 0: Object reference not set to an instance of an object.
Indicator 'RMMA': Error on calling 'OnBarUpdate' method on bar 11: 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.
Any pointers?
TY
Comment