【HPI】
[code]inputs: OneCent( numericsimple ), SmFactor( numericsimple ) ;variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( 0 ) ;
var0 = ( H + L ) * .5 ;
if CurrentBar = 1 then
HPI = 0
else
begin
var1 = MaxList( OpenInt, OpenInt[1] ) ;
var2 = 2 * AbsValue( OpenInt - OpenInt[1] ) ;
var3 = var0 - var0[1] ;
if var1 = 0 then
var4 = 0
else
begin
if BarType >= 2 and BarType < 5 then
begin
if var3 > 0 then
var4 = OneCent * Volume * var3 * ( 1 + var2 / var1 )
else if var3 < 0 then
var4 = OneCent * Volume * var3 * ( 1 - var2 / var1 ) ;
end
else
begin
if var3 > 0 then
var4 = OneCent * Ticks * var3 * ( 1 + var2 / var1 )
else if var3 < 0 then
var4 = OneCent * Ticks * var3 * ( 1 - var2 / var1 ) ;
end ;
end ;
HPI = HPI[1] + SmFactor * ( var4 - HPI[1] ) ;
end ;
[/code]
页:
[1]