Hello I saw this code online
input period = 20; #hint period:Number of bars to look in
def Hi = fold i = 0 to period with n = high do Max(n, GetValue(high, i, period - 1));
def Lo = fold k = 0 to period with m = low do Min(m, GetValue(low, k, period - 1));
AddLabel(1, "High in last " + period + " bars = " + Round(Hi,2), Color.GREEN);
AddLabel(1, "Low in last " + period + " bars = " + Round(Lo,2), Color.GREEN);
my question is where is the line where the next number in fold is being calculated?
there are 2 fold statements here and then 2 addlabel commands, where does it end and then the next fold number is processed?
thank you
input period = 20; #hint period:Number of bars to look in
def Hi = fold i = 0 to period with n = high do Max(n, GetValue(high, i, period - 1));
def Lo = fold k = 0 to period with m = low do Min(m, GetValue(low, k, period - 1));
AddLabel(1, "High in last " + period + " bars = " + Round(Hi,2), Color.GREEN);
AddLabel(1, "Low in last " + period + " bars = " + Round(Lo,2), Color.GREEN);
my question is where is the line where the next number in fold is being calculated?
there are 2 fold statements here and then 2 addlabel commands, where does it end and then the next fold number is processed?
thank you