【ExtremesFC】
[code]inputs:PriceValue( numericseries ),
Len( numericsimple ),
HiLo( numericsimple ),
oExtremeVal( numericref ),
oExtremeBarRaw( numericref ) ;
variables:
var0( 0 ),
var1( Len - 1 ) ;
condition1 = CurrentBar = 1
or ( HiLo = 1 and PriceValue < var0 )
or ( HiLo = -1 and PriceValue > var0 ) ;
if condition1
then
begin
var1 = var1 + 1 ;
if var1 >= Len then
begin
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 ;
end ;
end
else
begin
var0 = PriceValue ;
var1 = 0 ;
end ;
oExtremeVal = var0 ;
oExtremeBarRaw = var1 ;
ExtremesFC = 1 ;
if false then
Value1 = ExtremesFC[1] ;
[/code]
页:
[1]