【RS_PriceExtension】
[code]inputs:NumDays( numericsimple ),
MinConsolIndex( numericsimple ),
FinalRangeFactor( numericsimple ),
PrevTrHighest( numericsimple ),
PrevTrLowest( numericsimple ),
PrevATR( numericsimple ),
DataArray[ Twelve, MaxNumDays ]( numericarray ),
Index( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ) ;
RS_PriceExtension = 0 ;
if PrevATR > 0 then
var0 = ( PrevTrHighest - PrevTrLowest ) / PrevATR
else
var0 = MinConsolIndex - 1 ;
var1 = MaxNumDays + 1 ;
var2 = Mod( Index + 1, var1 ) ;
condition1 = var0 >= MinConsolIndex and DataArray[ 9, var2 ] >
PrevATR * FinalRangeFactor ;
if condition1 then
begin
var3 = DataArray[ 4, var2 ] - DataArray[ 1, Mod( Index + NumDays,
var1 ) ] ;
if var3 > 0 then
RS_PriceExtension = 1
else if var3 < 0 then
RS_PriceExtension = 2 ;
end ;
[/code]
页:
[1]