Indicators

Linear Regression Indicator Explained

How the Linear Regression indicator fits a least-squares line to price for statistical trend measurement in Setup.Cash.

By Setup.Cash TeamLast updated 2026-07-032 min read215 words

Featured image placeholder

/og/setup-cash-og.svg

The Linear Regression indicator fits a least-squares straight line through the last N closes and plots the line's endpoint each bar. It's the statistician's moving average: instead of averaging the past, it models the trend and reports where the model says price should be now.

How It Works

  • A least-squares fit minimizes distance to all closes in the window.
  • The endpoint value leads a same-length SMA because the fit extrapolates the trend within the window.
  • Deviation of actual price from the regression value measures short-term stretch.

How to Trade It

Use it as a low-lag baseline (price above a rising regression line = trend intact), or trade the gap: price far above the regression value tends to revert toward it. Combined with its own Slope, you get direction and steepness as separate conditions.

Building It in Setup.Cash

Add Linear Regression in the strategy builder — the length input controls its sensitivity — and use its value in any entry, exit, or filter condition. You can also combine it with other tools in the Indicators Lab or via the AI indicator generator. The TOS StdDev All indicator draws the full regression channel. For the full category overview, see the advanced trend library guide.

Trend tools reward patience: pick one, pair it with a volatility or regime filter, and backtest before trading it live.

Not financial advice. Trading involves risk. Use backtesting and paper trading before risking real capital.

Related Posts

View all

Indicators

Slope Indicator Explained

How the Slope indicator quantifies trend steepness as a number your bot can threshold, and how to use it in Setup.Cash.

1 min read · 194 words

Start here

Build your trading bot workflow with structure

Use Setup.Cash to create, backtest, and paper trade rule-based strategies without relying on guesswork. Not financial advice. Trading involves risk.