INDICATORS · LINREG SLOPE

Linear Regression Slope in Crypto: Why the Value Changes Before Candle Close

The linear regression slope fits a straight line through the last N closes. The live bar is the end point of that line, which gives it outsized leverage on the slope.

Short answer

The slope of a least-squares line through N closes weights points by their distance from the centre of the window, so the newest and oldest bars have the most influence. For N = 20, the live bar's weight on the slope is (x − x̄) ÷ Σ(x − x̄)² = 9.5 ÷ 665 ≈ 0.0143 per $1, so a $500 intrabar swing changes the slope by about $7.1 per bar. Sign changes in the slope can appear and vanish mid-bar. Use closed values.

Which part of Linear Regression Slope uses the live bar

ComponentUses current bar?Effect intrabar
Oldest and newest barsLive bar is newestLargest leverage
Middle barsNoLittle leverage
Slope signYesCan flip intrabar

Worked for N = 20: x̄ = 9.5, Σ(x − x̄)² = 665, and the newest bar's coefficient is 9.5/665 ≈ 0.0143.

Review Linear Regression Slope in Crypto with bar replay before using it live.

Open ChartsPod replay

How much it moves inside one bar

Linear Regression Slope during one bar (illustrative)Linear Regression Slope during one bar (illustrative): OPEN: Slope +$4.0/bar; MID: −$500: ≈ −$3.1/bar; LATE: Recovery; CLOSE: +$1.2/bar.OPENSlope +$4.0/barMID−$500: ≈ −$3.1/barLATERecoveryCLOSE+$1.2/bar
Only Linear Regression Slope's closing value is kept in history. Original ChartsPod editorial graphic.
Illustrative intrabar range of Linear Regression Slope vs its closed valueIllustrative intrabar range of Linear Regression Slope vs its closed value: Live bar's slope weight (N=20) 0 ; Middle bar's weight 0 .ILLUSTRATIVE INTRABAR RANGE OF LINEAR REGRESSION SLOPE VS ITS CLOSED VALUELive bar's slope weight (N=20)0Middle bar's weight0
How far Linear Regression Slope travels inside a bar versus between bars. Original ChartsPod editorial graphic.

Rules

Linear Regression Slope signal hygieneLinear Regression Slope signal hygiene: Signals on closed bars; Bar-close alerts; Backtest uses the same rule; Live value labelled provisional; Settings identical across chart and alerts.LINEAR REGRESSION SLOPE SIGNAL HYGIENESignals on closed barsBar-close alertsBacktest uses the same ruleLive value labelled provisionalSettings identical across chart and alerts
Closed values are what history shows. Original ChartsPod editorial graphic.

Related: Linear Regression Channel in Crypto: Why the Value Changes Before Candle Close (regression channel).

Put Linear Regression Slope in Crypto next to price, flow and positioning in one workspace.

Open a ChartsPod workspace

Questions readers ask

Why does the regression slope change so much intrabar?

The newest point has the most leverage on the line.

Can the slope sign flip mid-bar?

Yes.

Closed bars?

Yes.

Sources and methodology

Indicator formulas are standard definitions; live-versus-closed behaviour follows TradingView's repainting documentation. Values in examples are illustrative.

  1. TradingView Pine Script: Repainting — live vs historical calculation.
  2. ChartsPod indicator reference — indicator calculations.

This article explains research tools and workflows. It is not financial advice, does not recommend buying or selling any asset and does not predict prices. Crypto derivatives carry a risk of rapid and total loss of margin.

CHARTSPOD EDITORIAL EDITION · RESEARCH AND EDUCATION ONLY · NOT FINANCIAL ADVICE.