Zero-lag MACD
The Zero-lag MACD is MACD rebuilt on de-lagged averages. It is a Momentum & Oscillators concept. The Library holds 1 implementation, ready to run on Vela.
Top Zero-lag MACD indicator
The top custom implementation, built on the original standard Zero-lag MACD formula.
1 total
Want to trade Zero-lag MACD? Put the implementation below on a live chart in Vela, and Quant will help you build a strategy on it and backtest it.
What is the Zero-lag MACD?
The Zero-lag MACD is MACD rebuilt on de-lagged averages. Standard MACD subtracts a 26-period EMA from a 12-period EMA and smooths the difference into a 9-period signal line; each EMA trails price, so crossovers arrive late. The zero-lag variant error-corrects those averages. The most common construction takes twice the EMA minus an EMA of that EMA (the correction behind DEMA); others pre-shift the input by adding the difference between the current price and the price roughly half a period back before smoothing, the idea behind ZLEMA.
The corrections have identifiable authors. Patrick Mulloy introduced the double-EMA idea in a 1994 Technical Analysis of Stocks & Commodities article on faster moving averages, and John Ehlers and Ric Way described their error-correcting filter in 2010. Community scripts then bolted these averages into the MACD architecture, which is why the zero-lag MACD exists as a family of open-source indicators rather than a single canonical study; popular platform versions differ in exactly which averages they correct.
The name overpromises, and the best-known treatment admits it in its title: Ehlers and Way called their paper "Zero Lag (Well, Almost)", because a filter that only sees past data cannot have zero lag. What the correction buys is earlier crossovers and a histogram that turns nearer the actual price turn, paid for with overshoot and extra false crosses in chop. Implementations also differ on which lines get de-lagged (fast, slow, signal, or all three), so two charts with the same label can disagree on the same bar.
The variant is best understood as one point on the smoothness-versus-timeliness line every momentum tool sits on. Raw measures such as ROC respond instantly but shake violently; heavily smoothed tools respond late but rarely whipsaw. De-lagging shifts MACD toward the responsive end without abandoning its structure, and unlike bounded oscillators such as RSI or the Stochastic Oscillator it stays unbounded, so there are no fixed overbought or oversold lines to read, only crossovers, the zero line, and divergences.
How to identify a zero-lag MACD on a chart
The variant looks like a standard MACD pane; the differences show up in behavior around turns.
- 1Add a zero-lag MACD script below price, keeping the familiar 12/26/9 defaults so comparisons stay clean.
- 2Plot a classic MACD with the same settings alongside it: the zero-lag lines hug price turns more tightly and cross a few bars earlier on most swings.
- 3Check the script's inputs or source to see which components are de-lagged, since fast-and-slow-only versions behave differently from ones that also correct the signal line.
- 4Watch a sharp reversal: visible overshoot beyond where the standard MACD turns, followed by a snap back, is the error-correction working as designed.
- 5Observe a sideways stretch: the histogram flipping sign noticeably more often than the classic version confirms you are looking at the more responsive construction.
How it's calculated
A MACD whose fast, slow, and signal averages are de-lagged so the lines turn with less delay.
The de-lag step 2 × EMA - EMA(EMA) is the DEMA formula, so this variant is a MACD built from DEMAs.
Other versions build the lines from ZLEMA (price plus its lag-corrected difference) instead; defaults mirror the standard MACD 12, 26, 9.
How traders use it
- With the standard MACD grammar, shifted earlier: line/signal crossovers, zero-line crosses for bias, and histogram inflections for acceleration, each firing a few bars sooner than the classic version.
- As the trigger in a two-speed setup, where a slower tool sets direction and the zero-lag MACD times entries in that direction, offsetting its higher false-signal rate.
- For divergence work, where the reduced lag places oscillator peaks closer in time to the price swings being compared; the same logic applies to hidden divergence in continuation setups.
- As a drop-in replacement in existing MACD systems to test whether earlier signals actually help; the answer differs by market and regime, and earlier is not automatically better.
- In confluence with bounded oscillators: direction and timing from the zero-lag MACD with a stretch filter from a bounded tool is a common way to avoid buying every early crossover into an exhausted move.
Zero-lag MACD vs. other momentum tools
MACD: Same architecture, different averages: MACD uses plain EMAs and accepts their lag, while the zero-lag variant error-corrects each average to fire earlier at the cost of overshoot and extra signals in chop.
Volume-weighted MACD: The volume-weighted variant changes what is averaged, weighting price by volume so heavily traded bars matter more. It attacks input quality; the zero-lag version attacks response time. The two modifications are independent and occasionally combined.
ROC: ROC is momentum with no smoothing at all: the percentage change over n bars, instantaneous but jagged. The zero-lag MACD keeps smoothing for readability and then corrects the delay, landing between raw ROC and the classic MACD in responsiveness.
Zero-lag MACD FAQ
Turn Zero-lag MACD into a trading strategy.
Open the implementation from this page in Vela. Quant, our coding agent, builds the strategy with you and backtests it on real data.
Browse this familyMomentum & Oscillators85 concepts mapped · 85 in the Library
- 5/35 Oscillator
- Accelerator Oscillator
- Accumulative Swing Index
- Adaptive Stochastic
- Adaptive/dynamic RSI
- APO
- Awesome Oscillator
- Balance of Power
- Bill Williams Profitunity
- Cardwell Positive/negative Reversals
- CCI
- Center of Gravity
- Centerline Regime
- Chande Forecast Oscillator
- Chande Momentum Oscillator
- Connors RSI
- Constance Brown Studies
- Coppock Curve
- Cyber Cycle
- Detrended Price Oscillator
- Disparity Index
- Divergence Variants & Confirmation
- Double Stochastic
- DSS Bressert
- Dynamic Momentum Index
- Elder Impulse System
- Elder Ray
- Elegant Oscillator
- Embedded Readings
- Ergodic Oscillator
- Firefly Oscillator
- Fisher Transform
- Gator Oscillator
- Hidden Divergence
- Impulse MACD
- Intraday Momentum Index
- Inverse Fisher Transform
- Know Sure Thing
- Laguerre RSI
- MACD
- MACD-V
- Momentum
- Momentum Expansion vs Contraction
- Momentum Thrust
- Oscillator of Oscillator
- Oscillator Swing Failure
- OsMA
- Overbought/oversold
- Polarized Fractal Efficiency
- PPO
- Premier Stochastic
- Pretty Good Oscillator
- Psychological Line
- QQE
- Qstick
- Rahul Mohindar Oscillator
- Rainbow Oscillator
- Reflex/Trendflex
- Regular Bullish/bearish Divergence
- Relative Momentum Index
- Relative Vigor Index
- ROC
- ROC-of-ROC
- RSI
- RSI Bands
- RSI Failure Swing
- RSI of Other Sources
- RSI Range Rules
- RSI-2
- Schaff Trend Cycle
- Special K
- Stochastic Momentum Index
- Stochastic Oscillator
- Stochastic Pop
- Stochastic RSI
- Swing Index
- Traders Dynamic Index
- TRIX
- True Strength Index
- Ultimate Oscillator
- Volume-weighted MACD
- Wave Trend Oscillator
- Williams %R
- Woodies CCI Conventions
- Zero-lag MACD
