inputs:
Length( 90 ),Std(58),
NumDevs( 0.382 ),
Displace( 0 ) ;
variables:
var0( 0 ),var1( 0 ),var2( 0 ),
var3( 0 ),var4(0),var5(0);
var0 = ( HighD(1)+LowD(1) )/2 + ( OpenD(0) -CloseD(1) ) ;
var1= Std ;
var3 = var0 + NumDevs * var1 ;
var2 = var0 - NumDevs * var1 ;
var4 = var0 - (1) * var1 ;
var5 = var0 + (1) * var1 ;
condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin
Plot1[Displace]( var0, "Mid" ) ;
Plot2[Displace]( var3, "Upper" ) ;
Plot3[Displace]( var2, "Lower" ) ;
Plot4[Displace]( var5, "Upper2" ) ;
Plot5[Displace]( var4, "Lower2" ) ;
if Displace <= 0 then
begin
condition1 = (h+l)/2 crosses over var3 ;
if condition1 then
Alert( "Price crossing over Upper band" )
else
begin
condition1 = (h+l)/2 crosses under var2 ;
if condition1 then
Alert( "Price crossing under Lower band" ) ;
end;
end ;
end ; |