TradingCharts

Linear Regression

Read the slope as trend: a rising regression line quantifies an uptrend, and slope flattening warns the trend is losing pace.

What it does

The Linear Regression indicator fits a least-squares straight line through the closes of the last N bars and plots the endpoint (or the whole line/channel) as each bar completes. The fit minimizes the sum of squared distances between price and the line, giving the statistically best straight-line description of the recent trend. Channel versions add parallel lines at a set number of standard deviations around the regression line.

Typeoverlaydraws on the price chart

How to add it

Click Indicators (ƒx) in the header.

Search “Linear Regression” and click the result.

Hover its legend row and click the gear to open settings.

How traders use it

  • Read the slope as trend: a rising regression line quantifies an uptrend, and slope flattening warns the trend is losing pace.
  • Trade reversion to the line: price stretched far above or below the regression line tends to return to it, especially inside a channel.
  • Use the channel edges (commonly 2 standard deviations) as entry zones with the line itself as the target.
  • Compare slopes across timeframes: aligned regression slopes on higher and lower timeframes strengthen trend conviction.

Inputs

Input Type Default Range / Options
Length number 9 1–2000

Plots & styling

Plot Style Default color
LinReg(9) line #2196F3

Every plot's color, line width and visibility can be changed on the Style tab. Precision, price-scale labels and status-line values are configurable at the bottom of the Style tab.

Tips

  • Right-click the indicator's line for quick actions — settings, visibility and removal without hunting through menus.
  • Use Add to favorites in the legend menu; starred studies surface at the top of the picker.
  • The legend eye toggles it off without losing your settings — handy for before/after comparisons.

Watch out for

  • Each new bar refits the entire line, so historical values of the drawn line change as data arrives; the plotted history is not what you would have seen live bar by bar.
  • A straight-line model fails around curved, accelerating or reversing price action.