hi everyone
how to compare the last Count higher with the other Count higher ?
MA50 = Average[50](close)
DecreaseMA50 = MA50 < MA50[1]
Count = 0
WHILE DecreaseMA50[Count] DO
Count = Count + 1
WEND
RETURN Count
Best Reguards,
You need to define a lookback period (say 50), to check the highest values witthin that range:
Try this one:
LookBack = 50
MA50 = Average[50](close)
DecreaseMA50 = MA50 < MA50[1]
Count = 0
WHILE DecreaseMA50[Count] DO
Count = Count + 1
WEND
IF (BarIndex mod LookBack) = 0 THEN
HH = highest[LookBack](Count)
ENDIF
RETURN HH as "HH",Count AS"Count"