【ExtremesArray】
[code]inputs:PriceValueArray[MaxSize]( numericarray ),
Size( numericsimple ),
HiLo( numericsimple ),
oExtremeVal( numericref ),
oExtremePosRaw( numericref ) ;
variables:
var0( 0 ),
var1( 0 ) ;
var0 = PriceValueArray[1] ;
var1 = 1 ;
for Value1 = 2 to Size
begin
condition1 = ( HiLo = 1 and PriceValueArray[Value1] > var0 )
or ( HiLo = -1 and PriceValueArray[Value1] < var0 ) ;
if condition1
then
begin
var0 = PriceValueArray[Value1] ;
var1 = Value1 ;
end ;
end ;
oExtremeVal = var0 ;
oExtremePosRaw = var1 ;
ExtremesArray = 1 ;
[/code]
页:
[1]