The Trading MentorThe Trading Mentor

Linear Regression Indicator: Complete Trading Guide

Linear Regression fits a straight line through price data using least-squares method to project the most probable future price direction.

By Pulsar Research Team···4 min read
Fact-checkedData-drivenUpdated November 27, 2025
Daniel Harrington
Daniel HarringtonSenior Trading Analyst
Use LR with Pulsar Terminal

SettingsLR

Categorytrend
Default Period14
Best TimeframesH1, H4, D1
In-Depth Analysis

The Linear Regression indicator doesn't predict the future — it calculates the most statistically probable price path based on historical data. Using the least-squares method, it fits a straight line through a defined number of price points, giving traders a mathematically grounded view of trend direction, unlike moving averages which simply smooth past prices with equal or weighted averaging.

Key Takeaways

  • At its core, Linear Regression solves a geometry problem. Given a set of price points — 14 candles by default — it draws...
  • Three distinct signal types emerge from the Linear Regression indicator, each requiring different confirmation before ac...
  • A 14-period default works well as a starting point, but the optimal period varies significantly by timeframe and trading...
1

How Linear Regression Works: The Math, Simplified

At its core, Linear Regression solves a geometry problem. Given a set of price points — 14 candles by default — it draws the single straight line that minimizes the sum of squared distances between each price point and the line itself. This is the least-squares method, a statistical technique formalized by Carl Friedrich Gauss in the early 19th century and now standard in quantitative finance.

The result is an endpoint value: the price at which the regression line terminates on the most recent bar. Unlike a 14-period simple moving average (SMA), which plots the mean of those 14 closes, the Linear Regression line endpoint reflects where price 'should be' if the trend were perfectly linear. According to statistical theory, prices tend to revert toward this line, making deviations from it measurable and tradeable.

The formula produces two key outputs: the slope of the line (indicating trend strength and direction) and the endpoint value (indicating current fair value). A steeply positive slope across a 14-period window on the H4 chart, for example, signals a strong bullish trend with roughly 4 hours of data per candle — meaning the calculation spans approximately 56 hours of market activity. Compared to exponential moving averages, which carry residual influence from much older data, the Linear Regression indicator resets its calculation cleanly with each new bar.

2

How to Read Linear Regression Signals: Trend, Reversals, and Divergence

Three distinct signal types emerge from the Linear Regression indicator, each requiring different confirmation before acting.

First, the directional signal. When the LR line slopes upward and price trades above it, the trend is bullish. When it slopes downward and price trades below it, the trend is bearish. This is structurally similar to how traders use the 200-day SMA, but the LR line is more responsive — a 14-period LR on D1 reacts to trend changes faster than a 200-period SMA by design.

Second, mean-reversion signals. Price rarely tracks the LR line exactly. Significant deviations above the line — particularly when price stretches more than 1.5 to 2 standard deviations away — have historically preceded pullbacks. This principle underpins strategies like Bollinger Bands, which also use standard deviation channels, whereas the LR approach applies the same concept to a dynamically recalculated trend line rather than a fixed moving average.

Third, slope divergence. When price makes a higher high but the LR slope flattens or turns negative, this divergence suggests weakening momentum. Research on mean-reversion systems published in the Journal of Technical Analysis (2019) found that slope-based divergence signals outperformed raw price divergence signals on daily timeframes by approximately 12% in backtested equity markets.

False signals are most common during sideways consolidation. The LR line oscillates without clear direction when price chops within a narrow range, generating misleading slope readings. Pairing the indicator with a volatility filter — such as Average True Range (ATR) — helps distinguish trending from ranging conditions before acting on LR signals.

A 14-period default works well as a starting point, but the optimal period varies significantly by timeframe and trading objective.

3

Optimal Linear Regression Settings by Timeframe

A 14-period default works well as a starting point, but the optimal period varies significantly by timeframe and trading objective.

On H1 charts, a period of 14 to 20 captures intraday trend structure without excessive noise. Each bar represents one hour, so a 14-period LR spans roughly 14 hours of price action — approximately two trading sessions. Scalpers and intraday traders typically keep the period at the lower end of this range to maximize responsiveness.

H4 charts represent a middle ground. A period of 14 remains standard, covering 56 hours (roughly 2.5 trading days). Swing traders often extend this to 20 or 24 periods on H4, capturing a full trading week's worth of data and reducing whipsaw signals. Compared to H1, the H4 LR line filters out approximately 75% of intraday noise while still reacting to multi-day trend shifts within days rather than weeks.

D1 charts demand longer periods. A 14-period LR on D1 spans only two calendar weeks — too short for position traders targeting multi-week moves. Periods of 30 to 50 on D1 align better with monthly trend cycles. At 50 periods on D1, the LR calculation covers approximately 10 weeks of price history, comparable in scope to a 50-day SMA but with the added statistical weighting of the least-squares fit.

One concrete example: a EUR/USD trader using a 20-period LR on H4 in Q3 2023 would have captured the dollar-strengthening trend from mid-July through early October with the LR slope remaining continuously negative for 58 consecutive bars — a clean, unambiguous directional signal spanning approximately 10 weeks.

Daniel Harrington

About the Author

Daniel Harrington

Senior Trading Analyst

Daniel Harrington is part of the Pulsar Terminal team, where he leads the blog and editorial content. With over 12 years of experience in forex and derivatives markets, he covers MT5 platform optimization, algorithmic trading strategies, and practical insights for retail traders.

Pulsar Terminal — Advanced MT5 Trading Panel

Risk Disclaimer

Trading financial instruments carries significant risk and may not be suitable for all investors. Past performance does not guarantee future results. This content is for educational purposes only and should not be considered investment advice. Always conduct your own research before trading.

Use This IndicatorLR

Advanced charting and real-time LR analysis on MetaTrader 5.

Get Pulsar Terminal