by lbikhope » Wed Jun 13, 2012 12:52 pm
---------------------------------
inputs: Price( Close ), Length( 35 ), pct( .15 ), Displace( 0 ),NumDays(4), NumHours(0), NumMinutes(0) ;
variables: Avg( 0 ), Shift( 0 ), LowerBand( 0 ), UpperBand( 0 ), mp(0), setup(false);
Avg = AverageFC( Price, Length ) ;
Shift = pct * AverageFC( Length,35 ) ;
UpperBand = Avg + Shift ;
LowerBand = Avg - Shift ;
condition1 = price <= UpperBand and price >= LowerBand;
condition2 = Price crosses under UpperBand or Price crosses over LowerBand;
if Displace <= 0 or CurrentBar > AbsValue( Displace )or BarStatus(1) = 2
then if condition2 then begin
if countif(condition1,35)>= 35 then setup = true
else setup = false;
end;
----- maybe that help