I have a custom indicator in NT7 which i'm migrating to NT8, I resolved all compilation errors but when loading the indicator to the chart, I'm getting exception when i assign the plot values. My first 2 plot values got initialized but 3 &4 at line 216 throw error. Could you please check and let me know how to set multiple plots in NT8?
//Output window
Long condition - 175 - True
Trend condition -187 True
made it to - 205
made it to - 208
made it to - 216
Indicator 'RMheikinashi': Error on calling 'OnBarUpdate' method on bar 1: 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.
//Code snippet
//6 plots
OnStateChange()
AddPlot(Brushes.Green, "BUY");
AddPlot(Brushes.OrangeRed, "SELL");
AddPlot(Brushes.Transparent, "closePlotUP");
AddPlot(Brushes.Transparent, "openPlotUP");
AddPlot(Brushes.Transparent, "closePlotDN");
AddPlot(Brushes.Transparent, "openPlotDN");
OnBarUpdate()
Print("made it to - 205");
Value[0] = plGreen[0];
Value[1] = plRed[0];
Print("made it to - 208");
if(trendState)
{
Print("made it to - 216");
Value[2] = plGreen1[0];
Value[3] = plRed1[0];
}
Comment