MACD Zero Lag
Jul 20, 2016

The MACD Zero Lag indicator provides a faster-responding version of the classic Moving Average Convergence Divergence by utilizing Double Exponential Moving Averages (DEMA) to reduce lag.
Usage
The MACD Zero Lag can be used similarly to the traditional MACD but with the advantage of earlier signal generation. Traders typically look for the following:
- Crossovers: A bullish signal occurs when the MACD line (blue) crosses above the Signal line (red). A bearish signal occurs when the MACD line crosses below the Signal line.
- Histogram Analysis: The histogram represents the difference between the MACD and Signal lines. Rising green bars indicate strengthening bullish momentum, while falling red bars indicate strengthening bearish momentum.
- Zero Line Crosses: Movements above the zero line suggest a positive trend, while movements below suggest a negative trend.
Details
This script implements "Zero Lag" logic by replacing standard EMAs with Double Exponential Moving Averages (DEMA). The DEMA formula ($2 \times EMA - EMA(EMA)$) is applied to both the fast and slow lengths to calculate the MACD line, and subsequently applied again to the MACD line itself to generate the Signal line. This mathematical reduction in lag allows the indicator to track price action more closely than standard momentum oscillators.
Settings
- Source: Determines which price data (close, open, hl2, etc.) is used for the calculations.
- Fast Length: The period for the shorter-term DEMA (default is 12).
- Slow Length: The period for the longer-term DEMA (default is 26).
- Signal Length: The period used to smooth the MACD line into the Signal line (default is 9).
FAQ
How do I access the MACD Zero Lag?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
How does this differ from the standard MACD?
Because it uses DEMA instead of standard EMA, the peaks and troughs of the MACD Zero Lag occur sooner, potentially allowing for earlier entries and exits.
Can I use this for divergence trading?
Yes, users can look for discrepancies between price action and the MACD Zero Lag peaks/troughs to identify potential trend exhaustion or reversals.
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.