{ Downloaded From https://www.WiseStockTrader.com } x:=Input("number of periods for APE",2,200,25); ax:= Max( Abs(HHV(H, x) - Ref(O, -(x-1))), Abs(LLV(L, x) - Ref(O, -(x-1))) ); a1:= Max( Abs(H - O), Abs(L - O) ); Log( ax / a1 ) / Log( x )