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, 259 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 07-05-2009, 07:19 PM   #26

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

I tried just the "open>high[1] or open<low[1]" without the currentsession or date coding and it works. So give it a go.

Goes to show you sometimes simple things work! LOL

Here is the currentsession function for you if you still want it:

Code:
{ Returns the session number of the session to which the current bar belongs; if the 
current bar does not belong to any session of the specified type, the function
returns -1. }

inputs:
	SessionType( numericsimple ) ; { 0 = autodetect, 1 = regular}

variables:
	Initialized( false ),
	MySessionCount( 0 ),
	BarLocation( 0 ),
	BT( 0 ) ;

arrays:
	SessionStart[ 1, 50 ]( 0 ),
	SessionEnd[ 1, 50 ]( 0 ) ; { these arrays allow for a maximum 50 sessions per
	 week }

CurrentSession = -1 ;

if Initialized = false then
	begin
	for Value1 = 0 to 1
		begin
		MySessionCount = SessionCount( Value1 ) ;
		for Value2 = 1 to MySessionCount
			begin
			SessionStart[ Value1, Value2 ] = MinutesIntoWeek( SessionStartDay(
			 Value1, Value2 ), SessionStartTime( Value1, Value2 ) ) ;
			SessionEnd[ Value1, Value2 ] = MinutesIntoWeek( SessionEndDay( Value1, 
			 Value2 ), SessionEndTime( Value1, Value2 ) ) ;
			end ;
		end ;
	Initialized = true ;
	BT = BarType ;
	end ;

BarLocation = MinutesIntoWeek( DayOfWeek( Date ), Time ) ;
MySessionCount = SessionCount( SessionType ) ;
for Value1 = 1 to MySessionCount
	begin
	if ( BarLocation > SessionStart[ SessionType, Value1 ] or ( BT = 0 and
	 BarLocation >= SessionStart[ SessionType, Value1 ] ) ) and BarLocation <=
	 SessionEnd[ SessionType, Value1 ] then
		begin
		CurrentSession = Value1 ;
		Value1 = MySessionCount ; { this short circuits the loop }
		end ;
	end ;


{ ** Copyright (c) 2001 - 2009 tradestation Technologies, Inc. All rights reserved. ** 
  ** tradestation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
MinutesIntoWeek Function:

Code:
inputs: 
	XDay( numericsimple), { pass in 0-6 for Sun-Sat }
	XTime( numericsimple ) ; { pass in 24 hr HHMM time }

MinutesIntoWeek = 1440 * XDay + TimeToMinutes( XTime ) ;


{ ** Copyright (c) 2001 - 2009 tradestation Technologies, Inc. All rights reserved. ** 
  ** tradestation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
TimeToMinutes Function:

Code:
inputs: XTime( numericsimple ) ;

Value1 = XTime * .01 ;

TimeToMinutes = 60 * IntPortion( Value1 ) + 100 * FracPortion( Value1 ) ;


{ ** Copyright (c) 2001 - 2009 tradestation Technologies, Inc. All rights reserved. ** 
  ** tradestation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
Hope that helps.

Last edited by simterann22; 07-05-2009 at 07:25 PM.
simterann22 is offline  
Reply With Quote
Old 07-05-2009, 08:47 PM   #27

Join Date: Feb 2007
Location: Fraser Coast
Posts: 45
Ignore this user

Thanks: 0
Thanked 3 Times in 3 Posts

Re: Gapless Squeeze

Thanks Simterann22, I give what you suggest a try

cheers
dovetree is offline  
Reply With Quote
Old 07-18-2009, 03:33 AM   #28

Join Date: Jul 2008
Location: Valdosta, GA
Posts: 48
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Gapless Squeeze

Great indicators simterann22. Is there any way to code a gapless RSI inside of gapless Bollinger Bands so they're in the same code and both plot on the right axis? I can scale them in the same panel on my charts, but they're skewed and aren't correctly plotting because I have to plot 1 or the other as no axis if they're together. If I put them together and try to plot them both on the right axis, it just shows a line across the page. Guess they need to be put in the same code originally to plot together accurately. Thanks again for your terrific indicators and help.

Curtis
clbradley is offline  
Reply With Quote
Old 07-18-2009, 07:24 AM   #29

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

I assume you are trying to plot the RSI BBs, not the actual price data BBs? If so, yes, you need to code them together as the BBs will be plotted relative to the RSI value not to price data.

Try this code:

Code:
Inputs:
		Price(Close),
		RSILength(14),
		Oversold(30),
		Overbought(70),
		SDev(1.5),
		AvgLength(14);
Vars:
		MyRSI(0),
		RSIBB(0),
		RSIAvg(0),
		BBsdev(0),
		Upper_Band(0),
		Lower_Band(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 currentsession(0)<>currentsession(0)[1] or date<>date[1] then 
  begin
	gap=GapCoef*(O-C[1]);
	Accum=Accum+gap;   
  end;

if BarType<=0 or BarInterval<60 then  //Valid only for Tick or Intraday	under 60min 
	
	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

Var: GL_Price(0);

GL_price = RelC;
If Price=open then GL_price = RelO;
If Price=high then GL_price = RelH;
If Price=low then GL_price = RelL;

MyRSI=RSI(GL_Price,RSILength);
RSIAvg=Xaverage(MyRSI,AvgLength);
BBsdev=StandardDev(MyRSI,AvgLength,1);

Upper_Band = ( RSIAvg + Sdev * BBsdev );
Lower_Band = ( RSIAvg - Sdev * BBsdev );

Plot1(MyRSI,"MyRSI");
Plot2(RSIAvg,"RSIAvg");
Plot3(Upper_Band,"UBand");
Plot4(Lower_Band,"LBand");
Plot5(Oversold,"Oversold");
Plot6(Overbought,"Overbought");
Attached Thumbnails
Gapless Squeeze-rsi-bb-gapless.jpg  
Attached Files
File Type: txt @RSI&BB Gapless.txt (1.5 KB, 22 views)
simterann22 is offline  
Reply With Quote
The Following User Says Thank You to simterann22 For This Useful Post:
kmarinelli (07-18-2009)
Old 07-18-2009, 01:35 PM   #30

Join Date: Feb 2009
Location: milan
Posts: 2
Ignore this user

Thanks: 1
Thanked 1 Time in 1 Post

Re: Gapless Squeeze

Hi simterann22!
I tried to realize a RadarScreen indicator of the Gapless Squeeze in order to receive a "Long" "Short" and "Flat" signals.. but I'm a really beginner. Could you help me? Thanks, kmarinelli.
kmarinelli is offline  
Reply With Quote
Old 07-18-2009, 04:09 PM   #31

Join Date: Jul 2008
Location: Valdosta, GA
Posts: 48
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Gapless Squeeze

Thanks so much simterann22. That looks great.
clbradley is offline  
Reply With Quote
Old 07-19-2009, 03:14 AM   #32

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

Quote:
Originally Posted by kmarinelli »
Hi simterann22!
I tried to realize a RadarScreen indicator of the Gapless Squeeze in order to receive a "Long" "Short" and "Flat" signals.. but I'm a really beginner. Could you help me? Thanks, kmarinelli.
Kmarinelli, first of all I am less than 3 months old in EL coding. I have simply learned by studying other coder's works and reading the reserved word and function descriptions in the help menu. The best way to learn is by observation and a desire to understand how code works. So my suggestion is to read the code below and also read the free TS pdf files on their website on EL.

Here is a basic Squeeze RadarScreen without the 'bells and whistles' I personally use.....but this is just as good. I have basically modified Blu-Ray's BR_Squeeze RadarScreen to suit this squeeze. I have not allowed for the Gaussian or Countertrend options as I do not really use them....you're on your own if you want to modify it. Why not try?

You can change the EL code to say "flat' in place of 'squeeze' if you like, just simply replace the text as such in the code.

Make sure you format the indicator...... General>Load additional data for accumulative calculations (say 100)....and Style>ago>number> reduce decimal to zero.

This version should work okay, though I have not fully tested it.


Enjoy.
Attached Files
File Type: eld @SK_SQUEEZE RADAR SCREEN.ELD (13.0 KB, 36 views)
File Type: txt Gapless Squeeze RadarScreen.txt (3.6 KB, 31 views)
simterann22 is offline  
Reply With Quote
Old 07-20-2009, 07:29 AM   #33

Join Date: Feb 2009
Location: milan
Posts: 2
Ignore this user

Thanks: 1
Thanked 1 Time in 1 Post

Re: Gapless Squeeze

Hi Simterann22!
great work for me. You're so generous, thanks a lot again!!! kmarinelli
kmarinelli is offline  
Reply With Quote
The Following User Says Thank You to kmarinelli For This Useful Post:
simterann22 (07-20-2009)

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 04:35 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.