I have written numerous posts about this subject, but my posts have been ignored.
Daily bars problem
For example
double close1 = Closes[1][1];
BarsRequiredToPlot
BarsRequiredToPlot does not affect the calculation of any Series<double> objects. All objects will be calculated, but not displayed. BarsRequiredToPlot is applied to the primary bars, and there is no logical need to apply it to the secondary bar series. Anything like
if (CurrentBars[0] <= BarsRequiredToPlot || CurrentBars[1] <= BarsRequiredToPlot) return;
Each indicator has a training period, where you wish to perform calculations, but not yet display the results, because they are inaccurate. If you do not perform the calculations during the training period (as you did with your code) then you will simply need to wait for 120 bars (60 hidden and 60 false bars) before your indicator works correctly.
Just check CurrentBars[0] and CurrentBars[1] against the value 0. That is entirely sufficient.
Comment