Linear Regression Indicator (LRI)
The Statistically Perfect 'Fair-Value' Trend Axis
Imagine drawing the single straight line that best fits the last N prices ā the one that minimizes the total squared error. That's exactly what the Linear Regression Indicator (LRI) does, then projects that line right onto the current bar. It becomes a rolling 'fair-value' centerline: prices above it are temporarily strong, below it are weak. Add channel bands (± k standard deviations) and you have dynamic support/resistance. It's the mathematically clean way to see both trend direction (slope) and deviation from the mean ā no arbitrary smoothing, just pure least-squares goodness.
The Math ā Simple Yet Powerful
On one napkin:
- For N prices, time index x = 0 (oldest) to Nā1 (newest).
- Fit line: y = α + βx (α = intercept, β = slope).
- Current LRI value (at newest bar): LRI = α + β(Nā1).
- Standard error Ļ measures average deviation ā use for channel bands (±1Ļ, ±2Ļ).
Every new bar drops the oldest price and recalculates ā the line rolls forward smoothly.
Most platforms plot the endpoint value; some also show full regression channel.
Reading the Line and Channels
What to watch:
- Positive steep slope: Strong uptrend ā bias long, lower channel as stop/support.
- Negative slope: Downtrend ā bias short, upper channel as resistance/stop.
- Slope near zero: Trend fading into range ā prepare mean-reversion tools.
- Price piercing +1Ļ then snapping back: Over-extension ā potential fade opportunity.
- Price hugging centerline: Equilibrium ā low conviction moves.
Slope changes fast (often within one bar of real shift), while the line itself lags about half the window.
Battle-Tested Trading Setups
Proven frameworks:
- Channel Pullback: In uptrend, buy test of lower 1Ļ band; stop below ā2Ļ; target upper band or 1.5R.
- Slope Filter: Only take MA crossovers or momentum signals when absolute slope exceeds threshold (e.g., annualized >5%).
- Slope Divergence: Price new high + falling slope ā exhaustion; confirm with RSI/MACD to short.
- Mean-Reversion Swing: When slope flat (< small ε), sell spikes to +1.5Ļ, buy dips to ā1.5Ļ.
Pair slope with volume or ADX ā strong slope + rising ADX = high-conviction trend.
The Wins and the Watch-Outs
Strengths
- Statistically optimal fit ā minimizes squared error.
- Gives both level (fair value) and velocity (slope).
- Foundation for channels, z-scores, and volatility stops.
- Clean, objective ā no arbitrary smoothing constants.
Limitations
- Equal weighting ā vulnerable to outliers; single freak bar tilts line.
- Built-in lag (~½ N bars) on the value itself.
- Window sensitive ā too short = noisy, too long = sluggish.
- Assumes linear trend ā curved markets need shorter N or alternatives.
Your LRI Setup Checklist
- Choose N matching timeframe: 20ā50 swings, 100ā200 position trades.
- Decide channel width (±1Ļ common for entries, ±2Ļ for stops).
- Backtest slope thresholds and pullback rules.
- Filter with momentum/volume ā avoid flat-slope traps.
- Consider robust variants or outlier clipping on wild assets.
Key Takeaways
LRI plots the rolling least-squares best-fit line ā your dynamic fair-value axis.
Slope shows trend velocity; channels give objective support/resistance.
Faster slope response than long averages, statistically clean fit.
Great for pullbacks, slope filters, divergences, and mean-reversion.
Tune N carefully, watch outliers, add confirmation ā and let the regression guide you to smarter trend and value plays. Stay fitted and trade sharp!
Linear Regression Indicator (LRI)
The Statistically Perfect 'Fair-Value' Trend Axis
Imagine drawing the single straight line that best fits the last N prices ā the one that minimizes the total squared error. That's exactly what the Linear Regression Indicator (LRI) does, then projects that line right onto the current bar. It becomes a rolling 'fair-value' centerline: prices above it are temporarily strong, below it are weak. Add channel bands (± k standard deviations) and you have dynamic support/resistance. It's the mathematically clean way to see both trend direction (slope) and deviation from the mean ā no arbitrary smoothing, just pure least-squares goodness.
Table of Contents
The Math ā Simple Yet Powerful
On one napkin:
- For N prices, time index x = 0 (oldest) to Nā1 (newest).
- Fit line: y = α + βx (α = intercept, β = slope).
- Current LRI value (at newest bar): LRI = α + β(Nā1).
- Standard error Ļ measures average deviation ā use for channel bands (±1Ļ, ±2Ļ).
Every new bar drops the oldest price and recalculates ā the line rolls forward smoothly.
Most platforms plot the endpoint value; some also show full regression channel.
Reading the Line and Channels
What to watch:
- Positive steep slope: Strong uptrend ā bias long, lower channel as stop/support.
- Negative slope: Downtrend ā bias short, upper channel as resistance/stop.
- Slope near zero: Trend fading into range ā prepare mean-reversion tools.
- Price piercing +1Ļ then snapping back: Over-extension ā potential fade opportunity.
- Price hugging centerline: Equilibrium ā low conviction moves.
Slope changes fast (often within one bar of real shift), while the line itself lags about half the window.
Battle-Tested Trading Setups
Proven frameworks:
- Channel Pullback: In uptrend, buy test of lower 1Ļ band; stop below ā2Ļ; target upper band or 1.5R.
- Slope Filter: Only take MA crossovers or momentum signals when absolute slope exceeds threshold (e.g., annualized >5%).
- Slope Divergence: Price new high + falling slope ā exhaustion; confirm with RSI/MACD to short.
- Mean-Reversion Swing: When slope flat (< small ε), sell spikes to +1.5Ļ, buy dips to ā1.5Ļ.
Pair slope with volume or ADX ā strong slope + rising ADX = high-conviction trend.
The Wins and the Watch-Outs
Strengths
- Statistically optimal fit ā minimizes squared error.
- Gives both level (fair value) and velocity (slope).
- Foundation for channels, z-scores, and volatility stops.
- Clean, objective ā no arbitrary smoothing constants.
Limitations
- Equal weighting ā vulnerable to outliers; single freak bar tilts line.
- Built-in lag (~½ N bars) on the value itself.
- Window sensitive ā too short = noisy, too long = sluggish.
- Assumes linear trend ā curved markets need shorter N or alternatives.
Your LRI Setup Checklist
- Choose N matching timeframe: 20ā50 swings, 100ā200 position trades.
- Decide channel width (±1Ļ common for entries, ±2Ļ for stops).
- Backtest slope thresholds and pullback rules.
- Filter with momentum/volume ā avoid flat-slope traps.
- Consider robust variants or outlier clipping on wild assets.
Key Takeaways
LRI plots the rolling least-squares best-fit line ā your dynamic fair-value axis.
Slope shows trend velocity; channels give objective support/resistance.
Faster slope response than long averages, statistically clean fit.
Great for pullbacks, slope filters, divergences, and mean-reversion.
Tune N carefully, watch outliers, add confirmation ā and let the regression guide you to smarter trend and value plays. Stay fitted and trade sharp!
Related Terms
Apply This Knowledge
Ready to put Linear Regression Indicator (LRI) into practice? Use our tools to analyze your portfolio and explore market opportunities.
This content is also available on our main website for public access.