LinearReg MACD
May 15, 2020

The LinearReg MACD indicator is a hybrid oscillator that combines linear regression analysis with the Moving Average Convergence Divergence (MACD) framework to identify trend direction and momentum shifts with reduced lag. By applying MACD calculations to a linear regression line rather than raw price data, this tool helps traders visualize smoothed trend transitions and potential reversal points.
Usage
The LinearReg MACD is primarily used to identify momentum shifts through its histogram and signal line interactions. Traders can interpret the indicator through several key visual cues:
- Histogram Color: The histogram bars indicate the general trend bias. Green bars represent a positive MACD value (bullish), while red bars indicate a negative MACD value (bearish).
- Signal Crosses: Crossovers between the MACD and the signal line are highlighted with colored crosses. A green cross appears during a bullish crossover (MACD crossing above signal), and a red cross appears during a bearish crossunder (MACD crossing below signal).
- Trend Strength: The distance of the MACD bars from the zero line reflects the strength of the current trend derived from the linear regression baseline.
Details
The indicator operates by first calculating a linear regression value based on the specified "Linear length." This regression acts as a smoothed representation of price action. Subsequently, two Simple Moving Averages (Fast and Slow) are calculated based on this linear regression value. The MACD is the difference between these two moving averages, and a signal line is derived by smoothing the resulting MACD value. This multi-step process aims to filter out market noise while maintaining responsiveness to significant price movements.
Settings
- Linear length: Determines the lookback period for the initial linear regression calculation.
- Fast Length: Sets the period for the fast Simple Moving Average used in the MACD calculation.
- Slow Length: Sets the period for the slow Simple Moving Average used in the MACD calculation.
- Signal Length: Adjusts the smoothing period for the signal line.
FAQ
How do I interpret the colored crosses on the indicator?
The crosses indicate momentum shifts. A green cross signifies a bullish crossover where the MACD moves above the signal line, while a red cross signifies a bearish crossunder where the MACD moves below the signal line.
Can I use this for trend-following strategies?
Yes, the indicator is designed to highlight trend direction through the histogram's position relative to the zero line and the interaction between the MACD and signal lines.
How can I access LinearReg MACD?
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.