Forums › ProRealTime English forum › ProBuilder support › Code of series of periods › Reply To: Code of series of periods
08/04/2019 at 1:52 PM
#104152
Sorry for reviving this old topic, but after thinking it over and with a whole additional year experience… VONASI was right (apart from resetting count to 0 at line 2 as suggested by Nicolas).
My code always compares the current candle to the previous one, which is not exactly what maximus78 wanted. Indeed I believed using CLOSE without brackets would do, but summation reads it as being CLOSE[0], then it shifts both every iteration, so that the next one would be CLOSE[1] compared to CLOSE[2] and so on. CLOSE does NOT remain CLOSE[0] thus making a loop necessary.