| Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL. |
![]() | | Tweet | |
Gapless Squeeze Details »» | |||||||||||||||||||||||||||
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
Screenshots Show Your Support
| |||||||||||||||||||||||||||
| Comments |
| | #2 | ||
![]() | Re: Gapless Squeeze Quote:
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. | ||
| |
|
| | #3 | ||
![]() | Re: Gapless Squeeze find the original thread attached. | ||
| |
|
| The Following User Says Thank You to simterann22 For This Useful Post: | ||
Tams (06-16-2009) | ||
| | #4 | ||
![]() | Re: Gapless Squeeze 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 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. ** } Enjoy. Last edited by simterann22; 06-16-2009 at 11:15 PM. Reason: Added intra code | ||
| |
|
| | #5 | ||
![]() | Re: Gapless Squeeze Code: RelO = O; RelC = C; RelH = H; RelL = L; 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; | ||
| |
|
| | #6 | ||
![]() | Re: Gapless Squeeze I'm wondering if it works fine with averages Is there a MACD Gapless indicator ? Is there an Average Gapless indicator ? | ||
| |
|
| | #7 | ||
![]() | MACD and EMA Gapless | ||
| |
|
| The Following User Says Thank You to simterann22 For This Useful Post: | ||
aaa (06-20-2009) | ||
![]() |
| Thread Tools | |
| 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 |