logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
MS Support  
#1 Posted : Friday, July 28, 2017 9:59:15 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,934

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)

John Ehler's article, “The Super Passband Filter”, presented his indicator, the Passband filter and suggested a ways to trade it.  The indicator formula listed below uses prompts to allow you to set whatever time periods are desire for the Passband filter.  The buy and sell signal formula have set those time periods are variables on the first two lines.  If you wish to use different time periods, you must change those two lines in all four formulas are the signals will not align.

Indicator:

Passband Filter

Code:
p1:= Input("short time periods", 1, 100, 40);
p2:= Input("long time periods", 2, 200, 60);
a1:= 5/p1;
a2:= 5/p2;
PB:= (a1-a2)*C + (a2*(1-a1)-a1*(1-a2))*Ref(C,-1) + ((1-a1) + (1-a2))*PREV - (1-a1)*(1-a2)*Ref(PREV,-1);
RMSa:= Sum( pb*pb, 50);
RMS:= Sqrt(RMSa/50);
pb;
0;
RMS;
-RMS

Trading Signals:

Enter Long:

Code:
p1:= 40;
p2:= 60;
a1:= 5/p1;
a2:= 5/p2;
PB:= (a1-a2)*C + (a2*(1-a1)-a1*(1-a2))*Ref(C,-1) + ((1-a1) + (1-a2))*PREV - (1-a1)*(1-a2)*Ref(PREV,-1);
RMSa:= Sum( pb*pb, 50);
RMS:= Sqrt(RMSa/50);
el:= Cross(pb,-RMS);
xl:= pb < Ref(pb, -1);
trade:= If(el, 1, If(xl, 0, PREV));
Cross(trade, 0.5)

Exit Long:

Code:
p1:= 40;
p2:= 60;
a1:= 5/p1;
a2:= 5/p2;
PB:= (a1-a2)*C + (a2*(1-a1)-a1*(1-a2))*Ref(C,-1) + ((1-a1) + (1-a2))*PREV - (1-a1)*(1-a2)*Ref(PREV,-1);
RMSa:= Sum( pb*pb, 50);
RMS:= Sqrt(RMSa/50);
el:= Cross(pb,-RMS);
xl:= pb < Ref(pb, -1);
trade:= If(el, 1, If(xl, 0, PREV));
Cross(0.5,trade)

Enter Short:

Code:
p1:= 40;
p2:= 60;
a1:= 5/p1;
a2:= 5/p2;
PB:= (a1-a2)*C + (a2*(1-a1)-a1*(1-a2))*Ref(C,-1) + ((1-a1) + (1-a2))*PREV - (1-a1)*(1-a2)*Ref(PREV,-1);
RMSa:= Sum( pb*pb, 50);
RMS:= Sqrt(RMSa/50);
es:= Cross(RMS,pb);
xs:= pb > Ref(pb, -1);
trade:= If(es, 1, If(xs, 0, PREV));
Cross(trade, 0.5)

Exit Short:

Code:
p1:= 40;
p2:= 60;
a1:= 5/p1;
a2:= 5/p2;
PB:= (a1-a2)*C + (a2*(1-a1)-a1*(1-a2))*Ref(C,-1) + ((1-a1) + (1-a2))*PREV - (1-a1)*(1-a2)*Ref(PREV,-1);
RMSa:= Sum( pb*pb, 50);
RMS:= Sqrt(RMSa/50);
es:= Cross(RMS,pb);
xs:= pb > Ref(pb, -1);
trade:= If(es, 1, If(xs, 0, PREV));
Cross(0.5, trade)

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.