Highest/Lowest Value of Moving Average

Is there a way to reference the highest or lowest value of a moving average?

The function for highest value is in the form:

HighVal(period , offset, [series])

I want that series variable to be the equivalent of something like SMA(50) so that would seem to preclude a custom series which seems to be tied to a specific time series—or am I missing something obvious?

You could use LoopMax. E.g. LoopMax(“SMA(50,ctr)”,100).

Thanks Yuval! That probably does do it. Still I was hoping something could be done with the HighVal function since it just comes across to me as more intuitive. Also I would like to do something similar with HighValBar. Do you see a workaround for HighValBar returning the number of bars since the high of a moving average?

One way is to create custom formula which calls another custom formula: the first custom formula calculates the maximum value and the second one compares the sma at each CTR against the max value (using 1st custom formula)…till they are equal

Without creating custom formulas you can use setvars - create one for max, and in the other loop thru using the stored max variable