Hello everybody, I am trying to generate an indicator that shows the all time high (evaluated at close) For that I am just checking when the close<close[1] and close[1]<close[2] (condition of relative maximum) The problem is that it shows me all the relative maximums even when they are lower than the previos higher maximums (see picture) I would like to add a condition like close>MM[1], but then the code does nothing. Could you please help me? Cheers // Show relative maximum MM=0 if (close < close[1]) and (close[1]>close[2]) then MM= close[1] else MM=MM[1] endif return MM as "MMHH" Modified code which does not work // Show absolute maximum MM=0 if (close < close[1]) and (close[1]>close[2]) and (close>MM[1]) then MM= close[1] else MM=MM[1] endif return MM as "MMHH"