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

Reply
Gapless Squeeze Details »»
Gapless Squeeze
Platform: , by simterann22 simterann22 is offline
Developer Last Online: Jan 2012 Show Printable Version Email this Page

Platform: Tradestation Rating: (2 votes - 5.00 average)
Released: 06-16-2009 Last Update: Never Installs: 9
 
No support by the author.

Here is a new squeeze indicator I have modified from open source code to ignore or partially ignore an opening gap. This may be helpful with futures but more so with stocks gapping in the opening of the session....so you can get in earlier

I am still somewhat of a newbie and since joining this site I have grown exponentially. So I want to give something back.

The idea was taken from John McCormick's gapless code:

https://www.tradestation.com/Discuss...Topic_ID=77574

I've converted the gapless code into a function 'Gapless'...see ELD. You can then cut and paste the Gapless indicator addin code below into any indicator that will benefit and allow you to replace the o,h,l,c values within the code. eg. BBs, Stoch, RSI, MACD etc.

******* Please note I have placed a limit in the function so that the gapless addin will only work with tick or intraday charts. If you switch to a larger timeframe the values will default to the real o,h,l,c and your indicator will look 'normal' again. You do not have to touch a thing, just realise it will do this. Also 60min charts may come out distorted as the gaps are too close together in time. Lower time frame charts work best*******

Please feel free to modify it to suit your needs and make it better.....and make sure you post of course.

As per the 'Squeeze'....

the BB Squeeze: Enter after dots turn from red to green in the direction of the histogram. Confirm with Gaussean squeeze dots (BB False)....green up, red down, simple. Go flat when the BB dots turn red or there is loss of momentum (histogram turns). Remember you must always confirm with other indicators.

Here is the code addin:

Code:
{-------------Gapless Addin----------------------------}
{'Gapless code' initially written by John McCormick May 2008
Converted by Simterann22 2009

The idea is that at a gap opening any indicator that relies 
	on previous bars to calculate its values will be distorted. This addin 'ignores' the gap.
Function 'Gapless' will only return gapless value if tick or intraday chart else normal value.}
	
// Simply cut and paste this into your code below your current vars :

Vars:
	RelO(0),		// Relative Open
	RelH(0),		// Relative High
	RelL(0),		// Relative low
	RelC(0);		// Relative Close


	relO=Gapless(1.0,O);
	//set Gapless coefficent to 1.0 to ignore gap(Gapless),0.5 Halfgap,0.0 Include Gap(Normal)	
	relH=Gapless(1.0,H);
	relL=Gapless(1.0,L);
	relC=Gapless(1.0,C);

	//now replace all O,H,L,C with RelO,RelH,RelL,RelC in your code
		
{--------------End Gapless Addin-------------------------}

Download Now

File Type: eld @SK_SQUEEZE.ELD (14.0 KB, 260 views)

Screenshots

Gapless Squeeze-sk_squeeze.jpg  

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 simterann22 For This Useful Post:
aaa (06-19-2009), larry (06-17-2009), roger27 (05-21-2010), soulman (06-28-2009), Tams (06-16-2009)

Comments
Old 06-16-2009, 09:03 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Gapless Squeeze

Quote:
The idea was taken from John McCormick's gapless code:
https://www.tradestation.com/Discuss...Topic_ID=77574


Thanks for the indicator. That's a nice implementation of the GapLess idea.

Can you copy and paste (quote) some of McCormick's explanations/thoughts here?
Not everybody has access to tradestation's forum.
Tams is offline  
Reply With Quote
Old 06-16-2009, 10:24 PM   #3

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

Re: Gapless Squeeze

Here you go.....

find the original thread attached.
Attached Files
File Type: pdf TS Forum Taming gap of indicators.pdf (348.8 KB, 199 views)
simterann22 is offline  
Reply With Quote
The Following User Says Thank You to simterann22 For This Useful Post:
Tams (06-16-2009)
Old 06-16-2009, 10:44 PM   #4

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

Re: Gapless Squeeze

Now I understand why John didn't make 'gapless' into a function....because indicators plotted on the same scale as the underlying eg. BBs will not plot correctly. He writes that for these 'accum' has to be added to the plot price. I made the gapless function for indicators in the subgraph.

If you wish here is a copy of the raw code without the need of a function:

Code:
variables:
	Avg( 0 ),
	SDev( 0 ),
	LowerBand( 0 ),
	UpperBand( 0 ),
	Price( 0 );

	// gapless day transitions - John McCormick May 2008
	
Vars:
	RelO(0),		// Relative Open
	RelH(0),		// Relative High
	RelL(0),		// Relative low
	RelC(0),		// Relative Close
	gap(0),			// the opening gap (modified by the gap coefficient)
	GapCoef(1.0),	// Gap Coefficient
	Accum(0);		// The sum of all the daily gaps

if date<>date[1] then 
  begin
	gap		=	GapCoef*(O-C[1]);
	Accum	=	Accum+gap;   
  end;

if BarType<=1 then  //Valid only for Tick or Intraday	 
	
	begin

		RelO	=	O-Accum;
		RelC	=	C-Accum;
		RelH	=	H-Accum;
		RelL	=	L-Accum;

		end

		else begin

		RelO	=	O;
		RelC	=	C;
		RelH	=	H;
		RelL	=	L;
	
	end;

// Gapless - end
For the BB code for eg. your code should look like this:

Code:
inputs:
	BollingerPrice( Close ),
	TestPriceUBand( Close ),
	TestPriceLBand( Close ),
	Length( 20 ),
	NumDevsUp( 2 ),
	NumDevsDn( -2 ),
	Displace( 0 ) ;

variables:
	Avg( 0 ),
	SDev( 0 ),
	LowerBand( 0 ),
	UpperBand( 0 ),
	Price( 0 );

	// gapless day transitions - John McCormick May 2008
	
Vars:
	RelO(0),		// Relative Open
	RelH(0),		// Relative High
	RelL(0),		// Relative low
	RelC(0),		// Relative Close
	gap(0),			// the opening gap (modified by the gap coefficient)
	GapCoef(1.0),	// Gap Coefficient
	Accum(0);		// The sum of all the daily gaps

if date<>date[1] then 
  begin
	gap		=	GapCoef*(O-C[1]);
	Accum	=	Accum+gap;   
  end;

if BarType<=1 then  //Valid only for Tick or Intraday	 
	
	begin

		RelO	=	O-Accum;
		RelC	=	C-Accum;
		RelH	=	H-Accum;
		RelL	=	L-Accum;

		end

		else begin

		RelO	=	O;
		RelC	=	C;
		RelH	=	H;
		RelL	=	L;
	
	end;

// Gapless - end

price = RelC;
If BollingerPrice=open then price = RelO;
If BollingerPrice=high then price = RelH;
If BollingerPrice=low then price = RelL;
Avg = AverageFC( Price, Length ) ;
SDev = StandardDev( Price, Length, 1 ) ;
UpperBand = Avg + NumDevsUp * SDev;
LowerBand = Avg + NumDevsDn * SDev;

if Displace >= 0 or CurrentBar > AbsValue( Displace ) then 
	begin
	Plot1[Displace]( UpperBand + accum, "UpperBand" ) ;
	Plot2[Displace]( LowerBand + accum, "LowerBand" ) ;
	Plot3[Displace]( Avg + accum, "MidLine" ) ;

	{ Alert criteria }
	if Displace <= 0 then
		begin
		if TestPriceLBand crosses over LowerBand then
			Alert( "Price crossing over lower price band" ) 
		else if TestPriceUBand crosses under UpperBand then
			Alert( "Price crossing under upper price band" ) ;
		end ;
	end ;


{ ** Copyright (c) 2005 tradestation Technologies, Inc. All rights reserved. ** 
  ** tradestation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
Find attached ELDs for a few of his indicators

Enjoy.
Attached Files
File Type: eld 20080601080830GAPLESS.ELD (16.5 KB, 97 views)
File Type: eld 20080602233304GL_ATR.ELD (4.3 KB, 92 views)
File Type: eld 20090606150816DMI_GAPLESS.ELD (4.3 KB, 98 views)

Last edited by simterann22; 06-16-2009 at 11:15 PM. Reason: Added intra code
simterann22 is offline  
Reply With Quote
The Following 2 Users Say Thank You to simterann22 For This Useful Post:
aaa (06-19-2009), Tams (06-16-2009)
Old 06-16-2009, 11:41 PM   #5

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

Re: Gapless Squeeze

Bear in mind that John's original code in the above ELDs do not include an intra day filter. You may remove

Code:
RelO	=	O;
		RelC	=	C;
		RelH	=	H;
		RelL	=	L;
and replace with

Code:
if BarType<=1 then  //Valid only for Tick or Intraday	 
	
	begin

		RelO	=	O-Accum;
		RelC	=	C-Accum;
		RelH	=	H-Accum;
		RelL	=	L-Accum;

		end

		else begin

		RelO	=	O;
		RelC	=	C;
		RelH	=	H;
		RelL	=	L;
	
	end;
simterann22 is offline  
Reply With Quote
Old 06-19-2009, 05:02 PM   #6
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Gapless Squeeze

ThanX simterann22 for all your informations

I'm wondering if it works fine with averages

Is there a MACD Gapless indicator ?

Is there an Average Gapless indicator ?
aaa is offline  
Reply With Quote
Old 06-19-2009, 07:21 PM   #7

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts

MACD and EMA Gapless

Here you go...... the formula will work with any.....as far as I know.... indicators. Just make sure if you're making your own MA or EMA etc to add 'accum' to the plot line in the EasyLanguage code.
Attached Thumbnails
Gapless Squeeze-macd-ema-gapless.jpg  
Attached Files
File Type: eld EMA GAPLESS.ELD (4.6 KB, 76 views)
File Type: eld MACD GAPLESS.ELD (5.1 KB, 78 views)
simterann22 is offline  
Reply With Quote
The Following User Says Thank You to simterann22 For This Useful Post:
aaa (06-20-2009)
Old 06-20-2009, 06:41 AM   #8
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Gapless Squeeze

????????????????????????? ???

Attached Thumbnails
Gapless Squeeze-picture-1.jpg  
aaa is offline  
Reply With Quote

Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone have the squeeze indicator pajusa Beginners Forum 32 05-06-2011 10:24 PM
BB Squeeze indicator januson Technical Analysis 28 10-25-2009 02:11 AM
Squeeze for NinjaTrader scattergun Coding Forum 5 03-18-2009 03:30 PM
Squeeze for Investor/RT bfrank Technical Analysis 2 03-13-2009 08:20 AM
BB Squeeze (Version of TTM Squeeze) ashokkuttan Market Analysis 26 08-14-2008 01:34 PM

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