【GenerateStrike】
[code]inputs: ProximityToStrike( numeric ), StrikeIncrement( numeric ) ;variables: var0( 0 ), var1( 0 ), var2( 0 ) ;
var2 = IntPortion( ProximityToStrike ) ;
if StrikeIncrement > 0 then
begin
var0 = IntPortion( Close / StrikeIncrement ) * StrikeIncrement ;
var1 = var0 + StrikeIncrement ;
if var2 = 0 then
begin
condition1 = AbsValue( Close - var1 ) <= AbsValue( Close - var0 ) ;
if condition1 then
GenerateStrike = var1
else
GenerateStrike = var0 ;
end
else if var2 > 0 then
GenerateStrike = var0 + ( var2 * StrikeIncrement )
else
GenerateStrike = var1 + ( var2 * StrikeIncrement ) ;
end ;
[/code]
页:
[1]