【C_BullEng_BearEng】
[code]inputs:Len( numericsimple ),
oBullishEngulfing( numericref ),
oBearishEngulfing( numericref ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ) ;
var0 = MaxList( Close, Open ) - MinList( Close, Open ) ;
var1 = XAverage( Close, Len ) ;
var2 = XAverage( var0, Len ) ;
oBullishEngulfing = 0 ;
oBearishEngulfing = 0 ;
if CurrentBar > 1 then
begin
condition1 = Close < var1
and Close > Open
and var0 > var2
and Close[1] < Open[1]
and var0[1] < var2[1]
and Close >= Open[1]
and Open <= Close[1]
and ( Close > Open[1] or Open < Close[1] );
if condition1
then
oBullishEngulfing = 1
else
begin
condition1 = Close > var1
and Close < Open
and var0 > var2
and Close[1] > Open[1]
and var0[1] < var2[1]
and Close <= Open[1]
and Open >= Close[1]
and ( Close < Open[1] or Open > Close[1] );
if condition1
then
oBearishEngulfing = 1 ;
end;
end ;
C_BullEng_BearEng = 1 ;
[/code]
页:
[1]