The Dynamic Market Lab The Dynamic Market Lab right border
Knowledge Base » Examples and Formulas » Min/Max Loop

Problem: Find the maximum of "Price", over the past "X" periods.

In Tradestation or a similar language, you may have done this:


For count = 0 to IntPortion (X + 0.5) - 1 begin

If Price[count] > max then max = Price[count];

End;



Here is how you accomplish this loop in Metastock with ASI:


max := ExtFml( "ASI.HHV", Price, X);