When I add the indicator to the chart I get a run time error. This is the line of code I get the error on.
DrawRectangle("Rectangle_up_"+ '_' + CurrentBars[BarsInProgress], false, 0, BarLow, lineLength, BarHigh, Color.Green, Color.PaleGreen, opacity);
this is the error I get from the log:
Error on calling 'OnBarUpdate' method for indicator 'zones_9_ms_ind_ind' on bar 20702: zones_9_ms_ind_ind.DrawRectangle: startBarsAgo out of valid range 0 through -1, was 0.
The drawrectagle is hard coded for startBarsAgo = 0, I tried -1. same error.
The message says startBarsAgo range must be 0 to -1, and it is 0.
Last time i checked 0 is in the range of 0 to -1. Not sure how to fix this one.
Comment