Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/12/2007(UTC) Posts: 32
|
Wabbit
I have applied your formula for envelopes to my custom indicator used for identifying trading setups. I've found that when setting the input variable above the defualt values the indicator is removed from the chart's inner window. Can you see why this happening and is there a solution?
There is in the formula a market switch (35day simple moving average) that enable me to identify both long and short setups. I've found reducing this moving average seem to make the problem worse.
Setup custom Indicator
x:=Input("Short Term Moving Average",7,14,7); y:=Input("Envelopes Percentage variation",1,99,5)/100;
EMA:=Mov(C,x,E); UB:=Mov(C,x,S)*(1+y); LB:=Mov(C,x,S)*(1-y); B1:= H>UB AND H<=UB+(0.75*Abs(EMA-UB)) AND ValueWhen(1, H>UB, UB>Ref(UB,-1) ); B2:= L>EMA AND H<UB; abort:=(Sum(ub>Ref(ub,-1),3)=3 AND Sum(B2,2) = 2 AND Ref(B1, -2) AND Ref(L<EMA,-3)) OR (H>UB+(0.75*Abs(EMA-UB))); bdown:= L<=LB; bup:= BarsSince(C<EMA) < BarsSince(abort) AND H>UB;
notrade:= If(Abort, 1, If(Bdown OR Bup, 0, PREV)); B12:= (B1 OR B2) AND Mov(C,35,S)>Ref(Mov(C,35,S),-1) AND notrade=0; B3:= L<LB AND L>=LB-(0.75*Abs(EMA-LB))AND ValueWhen(1, L<LB, LB<Ref(LB,-1) ); B4:= EMA>H AND L>LB; AbortS:=(Sum(LB<Ref(LB,-1),3)=3 AND Sum(B4,2)=2 AND Ref(B3,-2) AND Ref(H>EMA,-3)) OR (L<LB-(0.75*Abs(EMA-LB))); BdownS:= H>=UB; BupS:= BarsSince(C>EMA) > BarsSince(AbortS) AND L<LB; notradeS:=If(AbortS, 1, If(BdownS OR BupS, 0, PREV)); B34:= (B3 OR B4) AND Mov(C,35,S)<Ref(Mov(C,35,S),-1) AND notradeS=0; If(B12, 2, If(B34, 1, 0));
|