【RS_TrueExtremes】
[code]inputs:NumDays( numericsimple ),
DataArray[ Twelve, MaxNumDays ]( numericarray ),
Index( numericsimple ),
oPrevTrHighest( numericref ),
oPrevTrLowest( numericref ),
oPrevATR( numericref ) ;
variables:
var0( 0 ),
var1( 0 ) ;
var0 = MaxNumDays + 1 ;
oPrevTrHighest = 0 ;
oPrevTrLowest = 1000000 ;
var1 = 0 ;
for Value1 = 1 to NumDays
begin
Value2 = Mod( Index + Value1, var0 ) ;
condition1 = DataArray[ 7, Value2 ] > oPrevTrHighest ;
if condition1 then
oPrevTrHighest = DataArray[ 7, Value2 ] ;
condition1 = DataArray[ 8, Value2 ] < oPrevTrLowest ;
if condition1 then
oPrevTrLowest = DataArray[ 8, Value2 ] ;
var1 = var1 + ( DataArray[ 7, Value2 ] - DataArray[ 8, Value2 ] ) ;
end ;
oPrevATR = var1 / NumDays ;
RS_TrueExtremes = 1 ;
[/code]
页:
[1]