This ProBuilder code snippet is designed to find the bar numbers where the highest and lowest prices occurred within the last 100 bars. It is useful for analyzing price movements in trading data.
Massimo = 0
Minimo = 999999
BarraMinimo = 0
BarraMassimo = 0
FOR i = 0 to 99
IF high[i] > Massimo THEN
Massimo = high[i]
BarraMassimo = i
ENDIF
IF low[i] < Minimo THEN
Minimo = low[i]
BarraMinimo = i
ENDIF
NEXT
EventoMassimo = BarIndex - BarraMassimo
EventoMinimo = BarIndex - BarraMinimo
Explanation of the Code:
This code is particularly useful for traders and analysts who need to pinpoint significant price levels and their occurrences over a defined historical period.
Check out this related content for more information:
https://www.prorealcode.com/topic/massimo-o-minimo/#post-84055
Visit Link