Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Bollinger Bands and Linear Regression Bands Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
bustermu
Posted : Sunday, December 9, 2007 1:59:25 PM
Registered User
Joined: 1/1/2005
Posts: 2,645

Bollinger Bands

Consider a horizontal straight line covering P data points of a time series end-to-end.  Least-mean-square error curve fit the horizontal line to the P data points.  The value taken on by the line is the mean (Mean) of the data points and the root-mean-square error of the curve fit is the standard deviation (StdDev) of the data points.  The Bollinger Bands of width w standard deviations are plots at the right endpoint of the horizontal line of:

Upper Band = Mean + w*StdDev

Middle Band = Mean

Lower Band = Mean - w*StdDev

We will describe a behavior of closing prices relative to the Bollinger Bands.  If the price trend is horizontal, price will ride the Middle Band.  If the price trend changes from horizontal to an up trend, the price will be above the Middle Band and the Upper Band and Lower Band will further separate.  If the price trend changes from horizontal to a down trend, the price will be below the Middle Band and the Upper Band and Lower Band will further separate.  If w = SQR(3*(P-1)/(P+1)), then a straight line trend up or down will ride the Upper Band or the Lower Band, respectively.  In order to observe this clearly, please bring up FX500 with SMA20 and BB(20,16) placed on Closing Price.

Linear Regression Bands

Linear Regression Bands are not to be confused with Linear Regression Channels.

Consider a straight line of arbitrary slope covering P data points of a time series end-to-end.  Least-mean-square error curve fit the line to the P data points.  This is the Linear Regression line.  The value taken on by the right endpoint of the line is the Linear Regression Moving Average (LRMA) of the data points and the root-mean-square error of the curve fit is the Linear Regression root-mean-square error (LRrms) of the data points.  The Linear Regression Bands of width w LRrms are plots
at the right endpoint of the straight line of:

Upper Band = LRMA + w*LRrms

Middle Band = LRMA

Lower Band = LRMA - w*LRrms

If the price trend is horizontal, up, or down price will ride the Middle Band and the Upper Band and Lower Band will not appreciably change their spacing because of a trend.

Visual Comparison

We wish to observe the two types of bands simultaniously.

Bollinger Bands:

Place SMA20 and BB(20,20) on Closing Prices.

Linear Regression Bands:

Custom Price Channel:
Visible - check
Plot Formula Line - check
Width Multiplier 20
Indicator Line Formula:
AVGC20+9.5*(9.5*(C0-C19)+8.5*(C1-C18)+7.5*(C2-C17)+6.5*(C3-C16)+5.5*(C4-C15)
+4.5*(C5-C14)+3.5*(C6-C13)+2.5*(C7-C12)+1.5*(C8-C11)+0.5*(C9-C10))/((20^2-1)*20/12)
Channel Width Formula:
SQR(ABS((C^2+C1^2+C2^2+C3^2+C4^2+C5^2
+C6^2+C7^2+C8^2+C9^2+C10^2
+C11^2+C12^2+C13^2+C14^2+C15^2
+C16^2+C17^2+C18^2+C19^2)/20
-AVGC20^2)
-12*(((0*C0+1*C1+2*C2+3*C3+4*C4+5*C5
+6*C6+7*C7+8*C8+9*C9+10*C10
+11*C11+12*C12+13*C13+14*C14+15*C15
+16*C16+17*C17+18*C18+19*C19)/20
-(20-1)*AVGC20/2)^2)/(20^2-1)))

Thanks,
Jim Murphy 

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.