【SwingIndex】
[code]variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( 0 ), var5( 0 ) ;if DailyLimit <> 0 then
begin
var2 = AbsValue( H - C[1] ) ;
var3 = AbsValue( L - C[1] ) ;
var4 = H - L ;
var5 = AbsValue( C[1] - O[1] ) ;
if var2 >= var3 then
begin
var0 = var2 ;
if var2 >= var4 then
var1 = var2 - 0.5 * var3 + 0.25 * var5
else
var1 = var4 + 0.25 * var5 ;
end
else
begin
var0 = var3;
if var3 >= var4 then
var1 = var3 - 0.5 * var2 + 0.25 * var5
else
var1 = var4 + 0.25 * var5 ;
end ;
if var1 <> 0 then
SwingIndex = 50 * ( ( ( C - C[1] ) + 0.50 * ( C - O ) + 0.25
* ( C[1] - O[1] ) ) / var1 ) * var0 / DailyLimit
else
SwingIndex = 0 ;
end ;
[/code]
页:
[1]