Skip to main content
Track Bollinger Bands
7 / 45
Library

1996issue C091-6

Constructing a standard-error envelope around a linear regression

A 21-period linear regression of closes sets the envelope center, and standard error of the estimate sets the width. Building that residual first shows why a tight mean-centered envelope is not the same object as a tight regression-centered envelope.

  • The envelope center is the last point of a 21-period linear regression of closes, and the outer lines sit two standard errors of the estimate above and below that point.
  • Both the regression end-value and the standard-error width are then smoothed with a three-period simple average so a single large close does not reprice the whole envelope.
  • The comparison construction uses a 20-period moving average of closes plus and minus two standard deviations, so its width tracks volatility around mean price rather than around a fitted line.
  • Percent A locates the close between the standard-error lines, while a tightness screen and a Fibonacci composite of 8-, 13-, and 21-period lookbacks are companion reads of the same workflow.
Entries in this reading3 entries

What the envelope is centered on

This article reconstructs a historical workflow for a three-line envelope centered on a linear regression of closes. A second envelope, centered on a moving average, is built beside it so residual width around a fitted line can be compared with volatility around mean price.

Linear regression, in this construction, is a least-squares line through a fixed lookback of ordered closes. It is used as the moving center of the envelope and as the baseline for residual width. The regression line is a least-squares fit drawn through the center of the lookback so observations sit with equal distance above and below the line.

The independent axis for the fit is a sequential bar index rather than calendar dates, so a weekend gap is not counted as multiple periods.

How the outer lines are set

The envelope center is the last point of a 21-period linear regression of closes, and the outer lines sit two standard errors of the estimate above and below that point.

Standard error of the estimate is the residual scatter of closes around the fitted regression line. It is the width term of the envelope. It is zero when every close equals that bar's regression value and rises as noise around the line increases.

Both the regression end-value and the standard-error width are then smoothed with a three-period simple average so a single large close does not reprice the whole envelope.

A mean-centered comparison

Bollinger bands are a three-line envelope whose middle line is a moving average of closes and whose outer lines sit a fixed number of standard deviations away, measuring volatility around mean price.

The comparison construction uses a 20-period moving average of closes plus and minus two standard deviations, so its width tracks volatility around mean price rather than around a fitted line.

A tightness screen divides a 55-period average true range by the width of the 21-period mean-centered bands and treats a reading of 50 percent or more as a compressed-volatility condition. That screen is a reading of mean-centered width, not of scatter around the fitted line.

Companion reads of location and stacked lookbacks

Percent A is the scaled location of the close between the lower and upper standard-error lines, with 100 at the upper line and 0 at the lower line. The companion oscillator equals 100 when the close is on the upper band and 0 when it is on the lower band. It is computed as the close minus the lower band, divided by band width, times 100.

Fibonacci retracement is used here as stacked lookbacks so 8-, 13-, and 21-period calculations can be averaged into one composite path. A Fibonacci composite averages the 8-, 13-, and 21-period versions of the same series so the shortest window leads, the middle window lags, and the longest window mutes one-bar shocks.

The coefficient of determination is the share of squared error removed by using the regression as predictor instead of the sample mean. When that Fibonacci-composite coefficient of determination is below 15, all three lookbacks are read as jointly at extreme lows.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
7 of 45 in the Bollinger Bands track
19961-3 pp.Next on Bollinger BandsDual-horizon ratio envelopes and regression error channelsThe ratio-series is a gold-mining index divided by a gold-bullion price, and it is formed before any envelope is drawn.
All readings on this track · 45 readings
  1. 1992Constructing volatility-scaled bands with relative strength index confirmation
  2. 1994Implied volatility as a band-defined regime filter for index options
  3. 1995Constructing projection bands from least-squares slopes
  4. 1995Constructing regression projection bands and range oscillators
  5. 1996Constructing Bollinger bands, percent-b, and stochastics
  6. 1996Constructing mechanical rules from Bollinger Bands and stochastics
  7. 1996Constructing a standard-error envelope around a linear regression
  8. 1996Dual-horizon ratio envelopes and regression error channels
  9. 1997Rational group structure with a trend screen, RSI, and bands
  10. 1997Asymmetric volatility band construction
  11. 1998Constructing three-state filters from Bollinger band envelopes
  12. 1999Combination filters with Bollinger Bands and the relative strength index
  13. 1999Constructing stochastic timed exits and band-RSI reversals
  14. 1999Evaluating Bollinger Bands against fixed-width and range-based envelopes
  15. 2000Constructing a Bollinger Band target as a forward price
  16. 2001Numeric candlestick encoding with local size bands
  17. 2001Ranked candlestick sentiment to band-cross entries
  18. 2002Combining Bollinger Bands, RSI, and a stop-loss
  19. 2002Bollinger Bands remain filters, not forecasts
  20. 2002Constructing a stochastic RSI with Bollinger bands
  21. 2002Constructing a StochRSI and Bollinger mechanical system
  22. 2003Constructing volatility-scaled Bollinger envelopes
  23. 2003Why tick breadth fails as a market personality
  24. 2005Constructing Bollinger bands versus fixed trading bands
  25. 2006Squared versus absolute deviation in envelope construction
  26. 2006Confirming yen crossovers with implied volatility and bands
  27. 2006A daily candle reversal is a hypothesis until shorter sessions fail at the same zone
  28. 2008Rebuild the Relative Strength Index as price-scale bands
  29. 2008Reading Relative Strength Index extremes on one price axis with Bollinger Bands and moving averages
  30. 2011Three-filter confirmation for short-swing futures
  31. 2011Constructing an inverse Fisher stochastic with bands and averages
  32. 2012Constructing a Bollinger Band indicator suite
  33. 2012Stacking price extremes, crossovers, bands, and MACD
  34. 2012Adaptive Bollinger band impulse, trend, and momentum filters
  35. 2013Rescaling stochastic, percent-B, and wave-count parameters
  36. 2014Industry-group quartile pivots as a Bollinger Bands case study
  37. 2014Bollinger Bands as adaptive price envelopes: a 2014 classroom case
  38. 2016Trend-channel entry rules from stacked moving averages
  39. 2016A permission stack for Bollinger, RSI, and the 50-period average
  40. 2017Constructing weighted Bollinger bands and volume averages
  41. 2017Four swing-entry rules that share a timed exit
  42. 2017Two-wave monthly cycles as a regime filter
  43. 2019Constructing exponential-deviation-bands from a midline-average
  44. 2020Critiquing exponential variants of Bollinger Bands
  45. 2020Constructing selectable volatility and moving-average bands
All 84 readings tagged Bollinger Bands
Also on Bollinger Bands5 readings