Least Squares Momentum
Jan 16, 2015

The Least Squares Momentum indicator is a trend-following and momentum tool that utilizes linear regression analysis at different offsets to identify support, resistance, and potential market reversals.
Usage
The indicator can be used to identify trend direction and momentum shifts by observing the relationship between three distinct linear regression lines: the Head, Mid, and Tail.
- Crossovers: A bullish signal is generated when the "Head" line (fast-reacting regression) crosses above the "Tail" line (lagging regression). Conversely, a bearish signal occurs when the "Head" crosses below the "Tail".
- Trend Confirmation: When the Head, Mid, and Tail lines are stacked in order (Head above Mid, Mid above Tail), it indicates a strong bullish trend. The opposite arrangement indicates a strong bearish trend.
- Support & Resistance: The regression lines, specifically the Tail and Mid, often act as dynamic support or resistance areas during trending markets.
Details
The script is constructed using three instances of the ta.linreg function, which calculates the least squares regression line over a specified lookback window. By applying different offsets (positive, zero, and negative), the script creates a visual representation of price momentum:
- Head: Uses a negative offset, effectively projecting the regression line forward to capture immediate price action.
- Mid: Uses no offset, representing the current linear regression equilibrium.
- Tail: Uses a positive offset, representing the trailing linear regression value.
This method allows traders to visualize the "velocity" of price changes relative to a calculated linear path.
Settings
- Length: The lookback period used for the linear regression calculations. Higher values result in smoother lines but more lag, while lower values are more reactive to price changes.
- Source: The price data point used for calculation (typically the Close price).
FAQ
How do I interpret the Head and Tail crossover?
A crossover of the Head over the Tail signifies that short-term price momentum is shifting faster than the historical average, often indicating the start of a new trend or a significant price breakout.
Can this indicator be used on any timeframe?
Yes, the Least Squares Momentum tool is mathematical in nature and adapts to any timeframe, though the "Length" setting may need adjustment to suit the volatility of specific periods.
How can I access the Least Squares Momentum indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.