Linear Regression Channel: the best-fit line and its error bands
How a regression channel fits a straight line through price and sets its bands by standard error, and why the channel repaints its own slope.
Linear Regression Channel is free on Basis — the button opens a live crypto chart with it already applied. No account, no trial and no limit on how many indicators you add.
Open the chartWhat it measures
A linear regression channel fits a least-squares straight line through the closes of a lookback window, then places bands above and below it at a multiple of the standard error of that fit.
The line is the trend as a statistician would define it: the straight line that minimises squared distance from the data. The bands describe how well price has been sticking to it.
Narrow bands mean the trend has been orderly; wide ones mean the line is a poor summary of what happened.
How it is calculated
These are the steps Basis performs, verified against the published definition.
- 1
Fit a least-squares line through the closes of the window, where x is the bar index.
- 2
Compute the standard error — the root mean square distance of the closes from that fitted line.
- 3
Place the bands at the line plus and minus the multiplier times the standard error.
- 4
Recompute the whole fit on every bar, which is why the channel moves as new data arrives.
Settings
| Setting | Default | Range |
|---|---|---|
| Length | 100 | 1 – 500 |
| Deviations | 2 | 0.1 – 10 |
| Source | close | price source |
A hundred-period window with two standard errors is a common setting. The window defines what trend you are measuring; the multiplier only decides how much of the noise the bands enclose.
How to read it
- The slope is the trend rate, in price per bar, which is a more precise statement than "it is going up".
- Price at the lower band in a rising channel is the conventional pullback entry; price outside the band is either exhaustion or a change of regime, and the channel cannot tell you which.
- A channel whose bands are widening is a trend losing its structure even while the slope stays positive.
Where it misleads
The entire channel is recomputed each bar, so its slope and position change as the window rolls — the channel you see today is not the channel that existed last week, even over the same bars. That makes it excellent for describing the current window and useless for claiming a level held historically. Any backtest reading a regression channel must recompute it causally at each bar, and one that fits the line over the whole dataset and then tests against it is reading the future in the most direct way possible.
Plot Linear Regression Channel on a live chart
Basis is free. Every indicator, every chart type, order flow, derivatives, screening and backtesting — no paid tier and no account needed to open a chart.
Open a chart with LinRegRelated indicators
Updated 2026-08-22 · Educational reference, not financial advice.