| 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 |
| | #26 | ||
![]() | Re: Gapless Squeeze 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. ** } 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. ** } 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. ** } Last edited by simterann22; 07-05-2009 at 07:25 PM. | ||
| |
|
| | #27 | ||
![]() | Re: Gapless Squeeze cheers | ||
| |
|
| | #28 | ||
![]() | Re: Gapless Squeeze Curtis | ||
| |
|
| | #29 | ||
![]() | Re: Gapless Squeeze 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"); | ||
| |
|
| The Following User Says Thank You to simterann22 For This Useful Post: | ||
kmarinelli (07-18-2009) | ||
| | #30 | ||
![]() | Re: Gapless Squeeze 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. | ||
| |
|
| | #31 | ||
![]() | Re: Gapless Squeeze | ||
| |
|
| | #32 | ||
![]() | Re: Gapless Squeeze Quote:
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. | ||
| |
|
| | #33 | ||
![]() | Re: Gapless Squeeze great work for me. You're so generous, thanks a lot again!!! kmarinelli | ||
| |
|
| The Following User Says Thank You to kmarinelli For This Useful Post: | ||
simterann22 (07-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 |