【Extremes】
[code]inputs:PriceValue( numericseries ),
Len( numericsimple ),
HiLo( numericsimple ),
oExtremeVal( numericref ),
oExtremeBar( numericref ) ;
variables:
var0( 0 ),
var1( 0 ) ;
var0 = PriceValue ;
var1 = 0 ;
for Value1 = 1 to Len - 1
begin
condition1 = ( HiLo = 1 and PriceValue[Value1] > var0 )
or ( HiLo = -1 and PriceValue[Value1] < var0 ) ;
if condition1
then
begin
var0 = PriceValue[Value1] ;
var1 = Value1 ;
end ;
end ;
oExtremeVal = var0 ;
oExtremeBar = var1 + ExecOffset ;
Extremes = 1 ;
[/code]
页:
[1]