Login Page

Support Board

  #1  
Old 04-02-2008, 06:35 PM
User Account
 
Join Date: Nov 2007
Posts: 56
Default Bollinger Squeeze indicator

I got this indicator quite a while back and searched this forum seeing that the code wasn't uploaded. Could one of the very gifted coders on this forum tackle this and make it for Sierra? Below is the source code from MT4. I've also attached it as a text document. Thanks so much!...EWB

-----------------------------------------------------------------------
Bollinger Squeeze Indicator - MT4

#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 DarkBlue
#property indicator_color4 Maroon
#property indicator_color5 Red
#property indicator_color6 Lime

//---- input parameters
extern int bolPrd=20;
extern double bolDev=2.0;
extern int keltPrd=20;
extern double keltFactor=1.5;
extern int momPrd=12;
//---- buffers
double upB[];
double upB2[];
double loB[];
double loB2[];
double upK[];
double loK[];

int i,j,slippage=3;
double breakpoint=0.0;
double ema=0.0;
int peakf=0;
int peaks=0;
int valleyf=0;
int valleys=0, limit=0;
double ccis[61],ccif[61];
double delta=0;
double ugol=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,3);
SetIndexBuffer(0,upB);
SetIndexEmptyValue(0,EMPTY_VALUE);

SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,3);
SetIndexBuffer(1,loB);
SetIndexEmptyValue(1,EMPTY_VALUE);

SetIndexStyle(4,DRAW_ARROW,EMPTY,2);
SetIndexBuffer(4,upK);
SetIndexEmptyValue(4,EMPTY_VALUE);
SetIndexArrow(4,159);
SetIndexStyle(5,DRAW_ARROW,EMPTY,2);
SetIndexBuffer(5,loK);
SetIndexEmptyValue(5,EMPTY_VALUE);
SetIndexArrow(5,159);

SetIndexStyle(2,DRAW_HISTOGRAM,EMPTY,3);
SetIndexEmptyValue(2,EMPTY_VALUE);
SetIndexBuffer(2,upB2);

SetIndexStyle(3,DRAW_HISTOGRAM,EMPTY,3);
SetIndexEmptyValue(3,EMPTY_VALUE);
SetIndexBuffer(3,loB2);


//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int shift,limit;
double diff,d,dPrev, std,bbs;

if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
limit=Bars-31;
if(counted_bars>=31) limit=Bars-counted_bars-1;

for (shift=limit;shift>=0;shift--) {
//d=iMomentum(NULL,0,momPrd,PRICE_CLOSE,shift);
d=LinearRegressionValue(bolPrd,shift);
dPrev=LinearRegressionValue(bolPrd,shift+1);
if(d>0) {
if ((dPrev>0) && (dPrev > d)){ upB2[shift]=d; upB[shift] = 0; } else { upB[shift]= d; upB2[shift] = 0; }
//upB[shift]=0;
loB[shift]=0;
loB2[shift]=0;
} else {
if ((dPrev<0) && (dPrev < d)){ loB2[shift]=d; loB[shift] = 0; } else { loB[shift]= d; loB2[shift] = 0; }
upB[shift]=0;
upB2[shift]=0;
//loB[shift]=d;
}
diff = iATR(NULL,0,keltPrd,shift)*keltFactor;
std = iStdDev(NULL,0,bolPrd,MODE_SMA,0,PRICE_CLOSE,shift);
bbs = bolDev * std / diff;
if(bbs<1) {
upK[shift]=0;
loK[shift]=EMPTY_VALUE;
} else {
loK[shift]=0;
upK[shift]=EMPTY_VALUE;
}
}
return(0);
}
//+------------------------------------------------------------------+


double LinearRegressionValue(int Len,int shift) {
double SumBars = 0;
double SumSqrBars = 0;
double SumY = 0;
double Sum1 = 0;
double Sum2 = 0;
double Slope = 0;

SumBars = Len * (Len-1) * 0.5;
SumSqrBars = (Len - 1) * Len * (2 * Len - 1)/6;

for (int x=0; x<=Len-1;x++) {
double HH = Low[x+shift];
double LL = High[x+shift];
for (int y=x; y<=(x+Len)-1; y++) {
HH = MathMax(HH, High[y+shift]);
LL = MathMin(LL, Low[y+shift]);
}
Sum1 += x* (Close[x+shift]-((HH+LL)/2 + iMA(NULL,0,Len,0,MODE_EMA,PRICE_CLOSE,x+shift))/2);
SumY += (Close[x+shift]-((HH+LL)/2 + iMA(NULL,0,Len,0,MODE_EMA,PRICE_CLOSE,x+shift))/2);
}
Sum2 = SumBars * SumY;
double Num1 = Len * Sum1 - Sum2;
double Num2 = SumBars * SumBars-Len * SumSqrBars;

if (Num2 != 0.0) {
Slope = Num1/Num2;
} else {
Slope = 0;
}

double Intercept = (SumY - Slope*SumBars) /Len;
double LinearRegValue = Intercept+Slope * (Len - 1);

return (LinearRegValue);

}

---------------------------------------------------------------------
Attached Files
File Type: txt bbsqueeze mt4.txt (4.8 KB, 704 views)
__________________

Good fortune to you!

EWB (a.k.a. CrashingMedic)
wadeboxjr@marten-enterprises.com
Yahoo! IM - MartenEnterprises
Skype IM - CrashingMedic
Join my free Yahoo! group at...
http://finance.groups.yahoo.com/group/theforextruth/
  #2  
Old 04-02-2008, 06:39 PM
User Account
 
Join Date: Nov 2007
Posts: 56
Default Re: Bollinger Squeeze indicator

Here is a screen shot of what it should look like...
Attached Thumbnails
Click image for larger version

Name:	s&p bb squeeze indicator - mt4.gif
Views:	1777
Size:	22.5 KB
ID:	999  
__________________

Good fortune to you!

EWB (a.k.a. CrashingMedic)
wadeboxjr@marten-enterprises.com
Yahoo! IM - MartenEnterprises
Skype IM - CrashingMedic
Join my free Yahoo! group at...
http://finance.groups.yahoo.com/group/theforextruth/
  #3  
Old 04-07-2008, 03:19 AM
User Account
 
Join Date: Feb 2008
Posts: 111
Default Re: Bollinger Squeeze indicator

Post this to the Support Board.
  #4  
Old 05-21-2008, 05:26 PM
GTG GTG is offline
User Account
 
Join Date: May 2008
Posts: 42
Default Re: Bollinger Squeeze indicator

Quote:
Originally Posted by CrashingMedic View Post
Here is a screen shot of what it should look like...
Thanks Medic for the squeeze. Is this the same as TTM squeeze by john carter?

GTG
  #5  
Old 05-22-2008, 05:24 AM
User Account
 
Join Date: Feb 2008
Posts: 782
Default Re: Bollinger Squeeze indicator

yes....I, for one, would love to see that BB Squeeze Indicator coded for Sierra.
  #6  
Old 05-22-2008, 04:47 PM
SC_SupportGroup's Avatar
Sierra Chart Support - Engineering Level
 
Join Date: Jan 2000
Posts: 61,170
Default Re: Bollinger Squeeze indicator

We will see about adding this.
__________________
Cheers
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy.

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
  #7  
Old 05-22-2008, 05:27 PM
User Account
 
Join Date: Feb 2008
Posts: 782
Default Re: Bollinger Squeeze indicator

Wonderful....thanks Admin
  #8  
Old 05-22-2008, 08:30 PM
User Account
 
Join Date: Jun 2007
Posts: 924
Default Re: Bollinger Squeeze indicator

here is code wrote for esignal
http://tradersguild.files.wordpress....squeezeefs.pdf

how to use: http://tradersguild.wordpress.com/20...eze-indicator/
  #9  
Old 05-23-2008, 06:02 PM
User Account
 
Join Date: May 2008
Posts: 666
Default Re: Bollinger Squeeze indicator

What do the different colored dots in the middle of the band mean?
  #10  
Old 05-24-2008, 01:53 AM
User Account
 
Join Date: Feb 2008
Posts: 782
Default Re: Bollinger Squeeze indicator

The TTM Squeeze Indicator: A Few Key Points:

* the TTM squeeze indicator was developed to keep from going cross eyed from looking at all of the line crosses. The TTM squeeze indicator visually represents what is happening with all of the lines.
* The TTM Squeeze Indicator is very easy strategy to learn and works on all time frames. We like the Two Minute and Five Minute time frames the best.
* The TTM Squeeze Indicator normal signal is red dots, no trade.
* When green dots appears, it means that the TTM squeeze indicator is on.
* When a green dots is followed by a red dot, it means that the TTM squeeze indicator has fired, volatility is expanding.
* The histogram(the vertical lines) is a measure of momentum; If it is blue we go long, if it is red we go short.



Need Assistance? Click "Chat Now" to chat with a Live Operator.



Chat Now No Thanks!
Live Support is offline. Click Here to leave a message
  #11  
Old 05-24-2008, 05:46 AM
User Account
 
Join Date: Jun 2007
Posts: 116
Default Re: Bollinger Squeeze indicator

I made a Squeeze using the Custom Worksheet features of SC quite a while back.

It is not ultimately ideal, but it seems to work. :)

-Scottorama

P.S. My .vts file was 13MB, so too big to upload... but if Admin would like to see it, I could get it to you.
Attached Thumbnails
Click image for larger version

Name:	1211607667_8_UploadImage.png
Views:	790
Size:	82.9 KB
ID:	1116  
  #12  
Old 05-27-2008, 05:45 PM
GTG GTG is offline
User Account
 
Join Date: May 2008
Posts: 42
Default Re: Bollinger Squeeze indicator

scottorama,

Thanks for the squeeze...I need it...please admin let him post it so we can take advantage of it or come up with with something very similar.

Thanks,
GTG
  #13  
Old 05-28-2008, 04:58 PM
SC_SupportGroup's Avatar
Sierra Chart Support - Engineering Level
 
Join Date: Jan 2000
Posts: 61,170
Default Re: Bollinger Squeeze indicator

13meg is not a problem. We will be working on this study.
__________________
Cheers
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy.

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
  #14  
Old 05-28-2008, 06:41 PM
GTG GTG is offline
User Account
 
Join Date: May 2008
Posts: 42
Default Re: Bollinger Squeeze indicator

Quote:
Originally Posted by Admin View Post
13meg is not a problem. We will be working on this study.
Thankyou,

Thatll be really helpful

GTG
  #15  
Old 06-11-2008, 10:20 AM
User Account
 
Join Date: Jun 2008
Posts: 6
Default Re: Bollinger Squeeze indicator

Any news of the progress of this study? You going to call it Bollinger squeeze or TTM Squeeze?



Quote:
Originally Posted by GTG View Post
Thankyou,

Thatll be really helpful

GTG
  #16  
Old 06-11-2008, 03:29 PM
GTG GTG is offline
User Account
 
Join Date: May 2008
Posts: 42
Default Re: Bollinger Squeeze indicator

Quote:
Originally Posted by m_grindy View Post
Any news of the progress of this study? You going to call it Bollinger squeeze or TTM Squeeze?
Theyre both the same thing. Admin said it should be added within the next 30 days. I need it for swing trades.

GTG
  #17  
Old 06-11-2008, 04:31 PM
User Account
 
Join Date: Jun 2008
Posts: 6
Default Re: Bollinger Squeeze indicator

Yes, it would be very useful, particularly for swing trades. You can kind of get a similar outcome by looking at about 4 different studies all at the same time, but not ideal so I hope that they release the new study soon!
  #18  
Old 06-11-2008, 05:13 PM
SC_SupportGroup's Avatar
Sierra Chart Support - Engineering Level
 
Join Date: Jan 2000
Posts: 61,170
Default Re: Bollinger Squeeze indicator

It will be called Bollinger squeeze and it will be done as soon as we can.
__________________
Cheers
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy.

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
  #19  
Old 06-11-2008, 07:29 PM
GTG GTG is offline
User Account
 
Join Date: May 2008
Posts: 42
Default Re: Bollinger Squeeze indicator

Quote:
Originally Posted by m_grindy View Post
Yes, it would be very useful, particularly for swing trades. You can kind of get a similar outcome by looking at about 4 different studies all at the same time, but not ideal so I hope that they release the new study soon!
I agree

GTG
  #20  
Old 06-27-2008, 01:38 PM
User Account
 
Join Date: Aug 2007
Posts: 225
Default Re: Bollinger Squeeze indicator

Just one more thank you! FWIW: the seller of this, John Carter, has labeled it "open source" (I imagine because it was first developed as open source by traders at TradersLaboratory), and has no problem with sharing the specifics of it. He'll provide the specifics and it's just up to the user to program it in. Also, it has evolved over time, and "his" current version, which I, and I imagine others, would like replicated if possible, is at the public url:
http://www.tradethemarkets.com/public/890.cfm

Thanks again so much for all the great work you all do!
  #21  
Old 07-18-2008, 02:44 AM
User Account
 
Join Date: May 2008
Posts: 666
Default Re: Bollinger Squeeze indicator

^ That link says "Service Unavailable."

Anyway I watched a video about this indicator and then made this. I wasn't exactly sure what values to use for the Keltner Channels and Bollinger Bands.

Oh yeah, and I can't figure out how to limit it to only display the green OR the red. I tried a few filtering methods but I got choppy results. I guess use an MA or something to help you choose a side, or just make the KC and BBs visible and trade in the direction of the breakout. The video said they used a momentum indicator to determine trade direction but when I applied that to limit it to displaying only red or green the results were hilarious.

Note that the red/green didn't display symmetrically with the default values for KC and BB, but I changed them a bit to what I think they are supposed to me.

And mine has the dots in the middle altho they may not be right (the first green after red(s) is the entry?).
Attached Thumbnails
Click image for larger version

Name:	BB Squeeze.gif
Views:	541
Size:	28.2 KB
ID:	1304  
  #22  
Old 07-18-2008, 03:01 AM
User Account
 
Join Date: May 2008
Posts: 666
Default Re: Bollinger Squeeze indicator

Yeah, this is how I gotta do it until I figure out how to stop it from showing both sides at the same time.
Attached Thumbnails
Click image for larger version

Name:	lol.gif
Views:	455
Size:	55.0 KB
ID:	1305  
  #23  
Old 07-18-2008, 03:52 AM
GTG GTG is offline
User Account
 
Join Date: May 2008
Posts: 42
Default Re: Bollinger Squeeze indicator

Quote:
Originally Posted by metalhead View Post
Yeah, this is how I gotta do it until I figure out how to stop it from showing both sides at the same time.
Thanks bro,

what are your calculations for the bollinger and KC. I tried doing it manually but they dont show as smooth as yours

Thanks
  #24  
Old 07-18-2008, 04:09 AM
User Account
 
Join Date: May 2008
Posts: 666
Default Re: Bollinger Squeeze indicator

I'm not sure if these are right, but for KC I have:
OHLC Avg
Keltner Mov Avg Length - 20
True Range Avg Length - 10
Top Band Multiplier - 1.5
Bottom Band Multiplier - 1.5
Keltner Mv Avg Type (Center Line) - Simple Mov Avg
ATR Mov Avg Type - Wilder's Mov Avg

And for BB I have:
Last
Length - 20
Standard Deviations - 2


I'm not sure I like these settings tho... the BBs are outside the KCs like 90% of the time so there's hardly ever red dots.

When I change those values tho I get some weird results.

I also kind of guessed on those because some of the codes I've seen list the values in a different way than SC does, like it says use an ATR of 1.5 for the KC. Well... if you change the "True Range Avg Length" field to 1.5 you get this super choppy mess, so they must be referring to something else. If anyone has any input into this I'd like to hear it.

edit - Changing the Keltner Mov Avg Length to 10 gives you clear signals that are always in the wrong direction. lol.

Last edited by metalhead; 07-18-2008 at 04:13 AM.
  #25  
Old 07-18-2008, 05:32 AM
User Account
 
Join Date: Aug 2007
Posts: 225
Default Re: Bollinger Squeeze indicator

Thanks, Metalhead for your work! SC admin "should" be releasing this soon, but as a lot have had problems with duplicating it, any additional help is MUCH appreciated! I'm clueless, unfortunately, re: programming. But, I have amassed a bit of info on this indicator, so to that end, here's what I have. Unfortunately, it's a hodgepodge of stuff I've collected, trying to piece it together and understand it. And sorry, but I haven't been real good about noting which stuff is actually from Carter and what has been done by others. Some of these were produced for TradeStation, which is what Carter uses, and in fact, may be the code of the actual one he sells. One final thing: the indicator has changed a bit over time; he didn't used to have the ATR in there (he mentioned that at a conference I attended).
Rather than I try to read the code from someone else's effort, see this link:
http://hankachilles.spaces.live.com/...5BAD!254.entry

Then I have this, which addresses your momentum and ATR questions:
#Indicator ' Carter Momentum
#Param "MomPer", 12 ' Momentum over [12-bars]
#Param "ChlPer", 20 ' Number of days/weeks under review
#Param "ATRmulti", 1.5 ' ATR Channel height [1.5 * ATR]
#Param "BBmulti", 1.5 ' BB channel height [1.5 * StDev]
Dim Chl as Single ' Channel height
Dim HiATRChl as Single ' Upper channel line
Dim LoATRChl as Single ' Lower channel line
Dim MidLn as Single ' Mid line
Dim HiBBChl as Single ' Upper Bollinger Band line
Dim LoBBChl as Single ' Lower Bollinger Band line
Dim MomHist as Single ' Carter Histogram
Dim BBUp as Single
Dim BBDo as Single
Dim BBMid as Single
Dim BBHis as Single

Chl = (ATR(ChlPer) * ATRmulti)
HiATRChl = SMA(ChlPer) + Chl
LoATRChl = SMA(ChlPer) - Chl
MidLn = SMA(ChlPer)
HiBBChl = BOL_UPPER(ChlPer,BBmulti)
LoBBChl = BOL_LOWER(ChlPer,BBmulti)

MomHist = MOM(MomPer) - 100

If HiBBChl > HiATRChl and MomHist > 0 Then
BBUp = MomHist
BBDo = 0
Else If LoBBChl < LoATRChl and MomHist < 0 Then
BBUp = 0
BBDo = MomHist
Else
BBMid = MomHist
End If

PlotHist("CarterUp", BBUp, 0, Green, 3)
PlotHist("CarterDown", BBDo, 0, Red, 3)
PlotHist("CarterMid", BBMid, 0, Burlywood, 3)

If HHV(BBUp,200) > LLV(BBDo,200) Then
BBHis = BBUp
Else
BBHis = BBDo
End If
SetScales(-BBHis,BBHis)

Return MomHist


Then, I noted this from his screen on one of his vid's; not sure if it will help.
HCY_TheSqueeze (Close,20,13,21,1.5,2,1,Red,Blue,False,...)

Not sure if I can include a screenshot, or if it will help, but this is from today. I copied it into word, and boy I'm going to sound dumb, but can't copy it to here, so I'm going to attach a word doc with just the image in?! I hope that's okay, and that it works. It appears so, so as long as I'm going nuts on this,

I'll include a video in which Carter explains and demonstrates it (jcsqueeze.swf) and some I've gotten for ninjatrader, in case you use it, and finally the one labeled 2-9-07 might help, or might not. I'm guessing Carter's vid will help the most. Note on his chart it was made last August, but I THINK it's the most recent incarnation of it. And the attachment labeled 2-9-07 is actually older, but inside the compilers note the dates of their changes, and give credit to the originator, and their thinking about it. Though the current squeeze is different, I thought you might find it interesting, anyway. Finally, on how it's used, I have this saved:
-The TTM Squeeze Indicator normal signal is red dots, no trade.
-When green dots appears, it means that the TTM squeeze indicator is on.
-When a green dots is followed by a red dot, it means that the TTM squeeze indicator has fired, volatility is expanding.
-The histogram (the vertical lines) is a measure of momentum; If it is blue we go long, if it is red we go short.
Thanks again, and I hope I've helped more than confused (or irritated SC).
Attached Files
File Type: doc Squeeze.doc (83.5 KB, 499 views)
File Type: zip Squeeze for NinjaTrader v6.5.zip (13.9 KB, 369 views)
File Type: doc TTM Squeeze for TS as of 2-9-07.doc (39.5 KB, 390 views)
 

Thread Tools Search this Subtopic
Search this Subtopic:

Advanced Search



All times are GMT. The time now is 08:24 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.