Linear Regression Forecast
Indicator
Linear Regression Forecast fits a straight line to the 14 closes before the current bar and extends it toward that bar: where the recent trend pointed.
Built on the moving regression in The New Technical Trader by Tushar Chande and Stanley Kroll, 1994. Reviewed by the ChartLabs team, updated Nov 2026.
Price is under a falling Forecast 14. The 14-bar fit points down.
Forecast 14 69,910.2 · Close 69,570.0
Price is under a falling Forecast 14. The 14-bar fit points down.
Forecast 14 69,910.2 · Close 69,570.0
Illustration on simulated data.
Linear Regression ForecastWhat is the Linear Regression Forecast indicator?
The forecast draws one grey line on the price chart. Each bar it fits a least-squares line through the 14 closes before that bar and reads the line half a bar past the newest of them, just before the current bar.
The current close is not in the fit. So the line shows where the recent trend pointed, and the close shows where price actually went. Closes above a rising forecast mean price is at least keeping pace with its trend.
It stays close to price, much like a Least Squares Moving Average built one bar earlier. In a steady trend it rides with the closes; after a sharp turn it keeps the old slope for a bar or two.
Half a bar back
ChartLabs reads the fitted line half a bar before the current bar: the mean of the 14 closes plus 7 times the slope. The live bar's value is set when the bar opens.
Warm-up
The first value is on the 16th bar. Earlier bars are left empty.
Linear Regression Forecast signalsFive patterns to know.
Price above a rising forecast
Closes keep beating the line the earlier bars projected.
Price under a falling forecast
Closes keep falling short of a line that points down.
Close back above
After a run under the line, a close lands above it and the next closes hold.
Close back under
After a long run above, price closes under the line and stays there.
Crossed both ways
Price crosses the line in both directions and the line goes nowhere.
Linear Regression Forecast formulaHow it is calculated.
Take the earlier closes
Use the 14 closes before the current bar.
Fit a line
Find the least-squares line through them: its mean and its slope per bar.
Extend it
Read the line half a bar after the newest of those closes: the mean plus 7 times the slope. That value is plotted on the current bar.
Linear Regression Forecast settingsEvery setting, explained.
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Length | 14 | 2 to 5,000 | Closes in the fit. Longer gives a steadier, slower line. |
| Source | Close | Any price | Which values feed the fit. |
| Line | Grey #999999, 1 px | Any colour and width | Colour and width of the line. |
- Setting
- Length
- Default
- 14
- Range
- 2 to 5,000
- What it changes
- Closes in the fit. Longer gives a steadier, slower line.
- Setting
- Source
- Default
- Close
- Range
- Any price
- What it changes
- Which values feed the fit.
- Setting
- Line
- Default
- Grey #999999, 1 px
- Range
- Any colour and width
- What it changes
- Colour and width of the line.
Drag to see how the setting changes the lines and how many signals you get. Illustration on simulated data.
Linear Regression Forecast strategiesUse it in 3 setups.
Close beats the forecast
A close above the line the earlier bars projected suggests the decline has stopped carrying on. Traders often wait for a second close.
Trend filter
Closes above a rising projection mean the trend is holding its pace.
Exit when price falls short
The close came in below where the recent trend pointed, a common reason to step aside.
Linear Regression Forecast mistakesCommon mistakes.
Acting on every close through it
The line sits close to price, so closes cross it often. Here a cross was undone within two bars.
Trading crosses in a range
With no trend to extend, the forecast wanders and crosses in both directions mean little.
Expecting it to call the low
The line extends past closes, so it turns after price does. Here the close above it came a few bars after the low.
Linear Regression Forecast combinationsPair it with these.
Linear Regression Forecast + Time Series Forecast
Fits the 14 closes up to and including the current bar and reads the line 3 bars ahead.
Linear Regression Forecast + Linear Regression Intercept
The other end of the same fitted line. The gap between the two is 14 times the slope.
Linear Regression Forecast + ATR
ATR shows how far a close normally strays from the forecast.
Linear Regression Forecast + ADX
ADX shows whether there is a trend for the forecast to extend.
Linear Regression Forecast FAQQuestions traders ask.
What are the default Linear Regression Forecast settings?
Length 14 on the close.
How is the forecast calculated?
It fits a least-squares line to the 14 closes before the current bar and reads it half a bar before that bar: the mean plus 7 times the slope.
Is it a price prediction?
No. It extends a straight line through recent closes. Prices rarely follow it for long.
Why is the current close not in the fit?
So the line shows where the trend pointed before the bar, and the close can be compared with it. It also means the live bar's value does not move.
Linear Regression Forecast or TSF?
TSF fits the 14 closes up to the current bar and reads 3 bars ahead, so it leads price. This forecast fits the closes before the bar and reads just before it, so it sits close to price.
Forecast or LSMA?
Both read the end of a fitted line. LSMA includes the current close; the forecast uses the closes before it.
Why does my value differ from another platform?
Some platforms include the current close or read the line a full bar ahead. ChartLabs fits the 14 closes before the bar and reads half a bar before it.
Does the forecast work on crypto?
Yes. It works on any market with closes.
Does it repaint?
No. Closed bars never change, and the live bar's value is set when the bar opens.
Is it leading or lagging?
Lagging. It extends a line through past closes.
Related indicatorsMore trend tools.
All trend indicatorsTry Linear Regression Forecast on a live chart.
Free. No download.
Works in your browser and on iPhone too.