1. def peak = high > Highest(high[1], LeftBarsThreshold) and high >= Highest(high[-RightBarsThreshold], RightBarsThreshold);
plot peakBoolean = peak;
Assuming LeftBarsThreshold is 5, Highest(high[1], LeftBarsThreshold) is Highest of 5 bars from 1 bar ago?
Assuming RightBarsThreshold is 5, Highest(high[-RightBarsThreshold], RightBarsThreshold) is Highest of 5 bars from 5 bars ago? I'm bit confused with the use of negative sign in front of bar index. Why not use Highest(high[5],RightBarsThreshold)?
2. def peakValue = if peak then high else peakValue[1];
What will be the value of peakValue[1] when the the above statement was executed for the first time? Does the array (peakValue) grow as each bar
is processed?
TY!
plot peakBoolean = peak;
Assuming LeftBarsThreshold is 5, Highest(high[1], LeftBarsThreshold) is Highest of 5 bars from 1 bar ago?
Assuming RightBarsThreshold is 5, Highest(high[-RightBarsThreshold], RightBarsThreshold) is Highest of 5 bars from 5 bars ago? I'm bit confused with the use of negative sign in front of bar index. Why not use Highest(high[5],RightBarsThreshold)?
2. def peakValue = if peak then high else peakValue[1];
What will be the value of peakValue[1] when the the above statement was executed for the first time? Does the array (peakValue) grow as each bar
is processed?
TY!