# Standard Error Bands

Standard Error Bands fit a linear regression line to price over a lookback window and plot bands offset above and below it by a multiple of the standard error of the regression estimate, so the bands tighten when price tracks its trend closely and widen when it does not. Defaults follow the classic settings: length 21, bands at plus and minus 2 standard errors, with 3-period smoothing applied. The build is a standard implementation of Jon Andersen's original formulation.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Apr 13, 2020.
- Access: free.
- Concepts: [Standard-error Channel](https://www.luxalgo.com/library/concept/standard-error-channel/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=jcc41sw51te8hewbsuetp3wa
- Page: https://www.luxalgo.com/library/indicator/standard-error-bands/

The **Standard Error Bands** fit a linear regression line to price over a lookback window and frame it with bands offset above and below by a multiple of the standard error of the regression estimate. The standard error measures scatter around the fitted trend, not a flat average, so the bands tighten when price hugs its trend and widen when the fit degrades: width reads as trend quality. This build is a standard implementation of Jon Andersen's original formulation with the classic defaults: a 21-bar regression, bands at plus and minus 2 standard errors, and 3-period smoothing. The smoothed midline plots as the Basis between the Upper Band and Lower Band, all three refitting as new bars arrive.

## How to Trade the Standard Error Bands?

- **Tight bands around a sloping Basis**: an orderly trend to trade with the slope.
- **Widening bands**: the trend is losing definition. Tighten risk or stand aside.
- **Close beyond either band**: an overextension past what the fitted trend allows, prone to revert toward the Basis, or the first sign of a turn, so confirm.
- **Pullbacks to the Basis**: in a clean trend, dips to the midline offer continuation entries near the trend's center.

## Standard Error Bands Settings

- **Length** (default 21): bars used to fit the regression and compute its standard error; longer for broader trends, shorter for recent swings.
- **SE Multiplier** (default 2): the standard-error multiple offsetting the bands; higher flags only larger dislocations, lower flags more often.
- **Smoothing** (default 3): the SMA applied to the regression line and both bands before plotting; 1 plots the raw fit.
- **Source** (default close): the price series the regression is fitted to.

## Alerts

Two alert conditions (Cross Above Upper Band and Cross Below Lower Band) fire when the close crosses the named band.

## Frequently Asked Questions

### How are Standard Error Bands different from Bollinger Bands?

Bollinger Bands widen with the standard deviation of price around a moving average, so width tracks volatility; these bands widen with dispersion around a fitted regression, so width tracks trend quality. A volatile market can still trend cleanly: wide Bollinger Bands, narrow error bands.

### What are the best settings for Standard Error Bands?

The 21/2/3 defaults are the classic published values. Lengthen the window when the larger trend matters, lower the SE Multiplier for earlier but noisier flags, and keep Smoothing just high enough to stop the channel jittering.

### What is the main limitation of Standard Error Bands?

The regression refits on every bar, so today's channel is not yesterday's. Width also says nothing about direction (a tight channel can be tightly falling), so pair band touches with a momentum or volume read.

## Related indicators

- [Volumetric Regression Heatmap](https://www.luxalgo.com/library/indicator/volumetric-regression-heatmap/) (Linear-regression Channel): markdown at https://www.luxalgo.com/library/indicator/volumetric-regression-heatmap.md
- [Trendlines with Breaks](https://www.luxalgo.com/library/indicator/trendlines-with-breaks/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/trendlines-with-breaks.md
- [Trendline Breakout Navigator](https://www.luxalgo.com/library/indicator/trendline-breakout-navigator/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/trendline-breakout-navigator.md
- [FVG Channel](https://www.luxalgo.com/library/indicator/fvg-channel/) (Parallel Channel): markdown at https://www.luxalgo.com/library/indicator/fvg-channel.md
- [Gann Square of 9 Vibration Levels](https://www.luxalgo.com/library/indicator/gann-square-of-9-vibration-levels/) (Gann Square of 9): markdown at https://www.luxalgo.com/library/indicator/gann-square-of-9-vibration-levels.md
- [Trendlines with Breaks Oscillator](https://www.luxalgo.com/library/indicator/trendlines-with-breaks-oscillator/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/trendlines-with-breaks-oscillator.md
- [Zig Zag Channels](https://www.luxalgo.com/library/indicator/zig-zag-channels/) (Parallel Channel): markdown at https://www.luxalgo.com/library/indicator/zig-zag-channels.md
- [Polynomial Regression Band](https://www.luxalgo.com/library/indicator/polynomial-regression-band/) (Trend): markdown at https://www.luxalgo.com/library/indicator/polynomial-regression-band.md

---

Source: https://www.luxalgo.com/library/indicator/standard-error-bands/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
