Welcome to the Traders Laboratory Forums.
Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL.

Reply
Squeezer Details »»
Squeezer
Platform: 8.6, by caglebagle caglebagle is offline
Developer Last Online: Oct 2009 Show Printable Version Email this Page

Platform: Tradestation Rating:
Released: 08-13-2009 Last Update: Never Installs: 8
 
No support by the author.

Here's a little indicator I coded a while back which displays the upper and lower band values when a bollinger band squeeze is on. The price lines disappear when the bands exit the squeeze. The idea is to place an entry bracket at price lines in anticipation of the breakout. Hope someone finds it useful.

Code:
inputs:
	BollingerPrice( close),
	bbLength( 13 ),
	NumDevsUp( 2 ),
	NumDevsDn( -2),
	Displace( 0 ) ,
	kPrice( Close ), 
	kLength( 13 ), 
	NumATRs( 1.5 ),
	Plotbb(false); 
	
variables:
	bbAvg( 0 ),
	kAvg(0),
	SDev( 0 ),
	bbLowerBand( 0 ),
	bbUpperBand( 0 ), 
	Shift( 0 ),
 	kLowerBand( 0 ), 
	kUpperBand( 0 ),
	decimals(autodecimals),
	rndbbupperband(0),
	rndbblowerband(0);
	

{bb}
bbAvg = AverageFC( BollingerPrice, bbLength ) ;
SDev = StandardDev( BollingerPrice, bbLength, 1 ) ;
bbUpperBand = bbAvg + NumDevsUp * SDev ;
bbLowerBand = bbAvg + NumDevsDn * SDev ;
{kc}
kAvg = AverageFC( kPrice, kLength ) ;
Shift = NumATRs * AvgTrueRange( kLength ) ;
kUpperBand = kAvg + Shift ;
kLowerBand = kAvg - Shift ;
{bb}
If plotbb=true then begin	
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then 
	begin
	Plot1[Displace]( bbUpperBand, "UpperBand" ) ;
	Plot2[Displace]( bbLowerBand, "LowerBand" ) ;
	Plot3[Displace]( bbAvg, "MidLine" ) ;
end;
{kc}
if Displace >= 0 or CurrentBar > AbsValue( Displace )  then 
	begin
	Plot4[Displace]( kUpperBand, "UpperBand" ) ;
	Plot5[Displace]( kLowerBand, "LowerBand" ) ;
	
	end;
end;

If bbUpperBand<=kUpperband or bbLowerband>=klowerband then begin
	setplotcolor(1,yellow);
	setplotcolor(2,yellow);
end;	

if lastbaronchart then begin
	
	value1=TL_new(currentdate, currenttime+5, bbUpperband, currentdate, currenttime+5, bbUpperband);
	value2=TL_new(currentdate, currenttime+5, bbLowerband, currentdate, currenttime+5, bbLowerband);
	
	TL_SetExtRight(1, true);
	TL_SetExtRight(2, true);
	

	TL_SetStyle(1, tool_solid);
	TL_SetStyle(2, tool_solid);
	


	TL_SetColor(1, yellow);
	TL_SetColor(2, yellow);
	

	TL_SetSize(1, 0);
	TL_SetSize(2, 0);


rndbbupperband=roundinst(bbupperband);
rndbblowerband=roundinst(bblowerband);
	value3=Text_New(Date, time, 0, numtostr(rndbbupperband,decimals));
	
	Text_SetLocation(1, currentDate, currenttime+5, bbupperband);
	Text_SetColor(1, green);
		
	value4=Text_New(Date, Time, 0, numtostr(rndbblowerband,decimals));
	Text_SetLocation(2, currentDate, currenttime+5, bblowerband);
	Text_SetColor(2, red);
If  bbUpperBand>=kUpperband or bbLowerband<=klowerband then begin
	TL_Delete(1);
	TL_Delete(2);
	Text_Delete(1);
	Text_Delete(2);
end;



	
end;
Let me know if you have any issues. Squeezer.eld is the indicator. Auto Decimals.eld and RoundInst.eld are functions referenced in the indicator.

JC

Download Now

File Type: eld SQUEEZER.ELD (9.3 KB, 125 views)
File Type: eld AUTO DECIMALS.ELD (2.6 KB, 77 views)
File Type: eld ROUNDINST.ELD (3.5 KB, 74 views)

Show Your Support

  • If you like to thanks you by the author -> Click Thanks to the Author
  • This modification may not be copied, reproduced or published elsewhere without the author's permission.
The Following 5 Users Say Thank You to caglebagle For This Useful Post:
birddog (08-13-2009), pathfinder62 (09-22-2009), Power555 (08-19-2009), sunilrohira (09-06-2009), Tams (08-13-2009)

Comments
Old 08-19-2009, 12:54 AM   #18

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Squeezer

JC.....thx.....but still can't get it to show on the charts, tho see it in there on the list. So, any other suggestions to make it visible would be much appreciated. When ya have time, no hurry. Thx again.....ajax
ajax358 is offline  
Reply With Quote
Old 08-19-2009, 10:03 AM   #19

Join Date: Sep 2007
Location: Mobile
Posts: 15
Ignore this user

Thanks: 3
Thanked 12 Times in 5 Posts

Re: Squeezer

You won't see anything until the keltners enter the bb's unless you turn the bands on. The lines disappear once the keltners exit. Try turning the bands on just to check if it's displaying.

JC
caglebagle is offline  
Reply With Quote
Old 08-20-2009, 01:52 AM   #20

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Squeezer

Quote:
Originally Posted by caglebagle »
You won't see anything until the keltners enter the bb's unless you turn the bands on. The lines disappear once the keltners exit. Try turning the bands on just to check if it's displaying.

JC
thx JC....will try that ....
ajax358 is offline  
Reply With Quote
Old 08-20-2009, 04:16 PM   #21

Join Date: Sep 2007
Location: Mobile
Posts: 15
Ignore this user

Thanks: 3
Thanked 12 Times in 5 Posts

Re: Squeezer

All I can think of is to try reinstalling it from the .eld file or maybe try placing carets around the the Tl_delete and text delete commands at bottom of code......this will force the price lines to always be displayed. It's been working on my machine with version 8.6, so I'm not really sure why it's misbehaving.

Hope it helps,
JC
caglebagle is offline  
Reply With Quote
Old 08-21-2009, 02:20 AM   #22

Join Date: Jun 2009
Location: Seattle
Posts: 63
Ignore this user

Thanks: 8
Thanked 18 Times in 16 Posts

Re: Squeezer

thx....will try it too, & await what you find.....still not working.....but try more I will.....thx for the help....
ajax358 is offline  
Reply With Quote

Reply

Thread Tools
Help Others By Rating This Thread
Help Others By Rating This Thread:


All times are GMT -4. The time now is 10:57 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.