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

Notification

Icon
Error

Options
Go to last post Go to first unread
Will808  
#1 Posted : Wednesday, August 31, 2011 11:50:40 AM(UTC)
Will808

Rank: Member

Groups: Registered, Registered Users
Joined: 9/25/2010(UTC)
Posts: 14

Hi, I found the following formula here on the forum for a squeeze play indicator - the chart looks very good, and I'm now looking to incorporate this into an exploration. Can anyone tell me what filters I need to make an expliration out of this? Many thanks for any help. { ©Copyright 2004~2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User inputs } pds:=Input("Keltner/Bollinger Bands periods", 1,252,10); spread:=Input("Keltner Bands % spread", 0,1000,100)/100; dev:=Input("Bollinger Bands deviation", .001,10,1); plot:=Input("[1]Keltner, [2]Bollinger, [3]Keltner+Bollinger",1,3,1); { Keltner bands } KBmid:=Mov(Typ(),pds,S); KBtop:=KBmid+Mov(H-L,pds,S); KBtopDiff:=(KBtop-KBmid)*spread; KBtop:=KBmid+KBtopDiff; KBbot:=KBmid-Mov(H-L,pds,S); KBbotDiff:=(KBbot-KBmid)*spread; KBbot:=KBmid+KBbotDiff; KBwidth:=KBtop-KBbot; KBwidthAvg:=Cum(KBwidth)/Cum(KBwidth>-1); { Bollinger bands } BBtop:=BBandTop(C,pds,S,dev); BBmid:=Mov(C,pds,S); BBbot:=BBandBot(C,pds,S,dev); { Plot on price chart } If(plot=1,KBtop,BBtop); If(plot=1,KBmid,If(plot=2,BBmid,KBtop)); If(plot=1,KBbot,BBbot); If(plot=1,KBbot,If(plot=2,BBbot,KBbot))
jjstein  
#2 Posted : Wednesday, August 31, 2011 4:11:55 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
What condition are you trying to select for?

Will808  
#3 Posted : Thursday, September 1, 2011 12:59:58 AM(UTC)
Will808

Rank: Member

Groups: Registered, Registered Users
Joined: 9/25/2010(UTC)
Posts: 14

That's a bit of a tough one since I'm struggling to interpret the code - but here is the text that went in the original post: "When Bollinger Bands (BB) fit inside the Keltner Channel (KC), a breakout is about to occur. It works on longer term charts, such as 15 minute to daily charts. This code creates an indicator that plots the ratio of BB width to KC width. When BB and KC widths are the same, the ratio (BBS_Ind)is equal to one (1). When the BB width is less than the KC Width (i.e. BB fit inside KC), the BBS_Ind is less than one and a breakout is indicated." So on that basis, I'm assuming that BBS_Ind < 1 should do it, but since I can't find BBS_Ind in the code posted above, I'm not sure which variable I should be using.
Will808  
#4 Posted : Thursday, September 1, 2011 1:01:45 AM(UTC)
Will808

Rank: Member

Groups: Registered, Registered Users
Joined: 9/25/2010(UTC)
Posts: 14

So in other words, a more simple answer is that the condition should be that the BB's fit inside the Keltner channels :) Thanks for any help on this.
jjstein  
#5 Posted : Thursday, September 1, 2011 1:04:39 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Well, you can replace the { Plot on price chart } section with this:

BBwidth:=BBtop-BBbot;
BBwidth/KBwidth;

...then, add Horizontal Line of "1".

I'm assuming a cross over "1" is a signal for long entry -- but, if so, don't hold your breadth.

Will808  
#6 Posted : Thursday, September 1, 2011 2:20:18 PM(UTC)
Will808

Rank: Member

Groups: Registered, Registered Users
Joined: 9/25/2010(UTC)
Posts: 14

Fantastic, many thanks Johnathan. Because it is a squeeze play, there is no long or short signal - the condition just states that a squeeze is set up, and you can trade long or short depending which way the following breakout goes. But if I'm following your logic and the comments on the original code correctly, if BBWidth < KBwidth, then the squeeze is set up. I'll give it a try in an exploration and report back here.
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.