All indicators

Zero Lag MACD

Nov 9, 2019

Static chart image
SignalsOscillatorsMoving Averages

The Zero Lag MACD indicator provides a versatile momentum oscillator that incorporates zero-lag moving average calculations and Laguerre filtering to reduce delay in trend identification. This tool enhances the classic MACD formula by offering multiple smoothing options and a "Leader" line to anticipate momentum shifts more effectively than standard exponential moving averages.

Usage

The Usage section describes how the script can be used for trend and momentum analysis. Traders can utilize the histogram and line crossovers to identify potential entry and exit points.

  • Zero Lag Interpretation: By using the ZLEMA (Zero Lag Exponential Moving Average) option, the indicator reacts faster to price changes than a standard MACD, potentially catching trend reversals earlier.
  • MACD Leader: When the Leader line is enabled, it acts as a more sensitive component that leads the standard MACD line. Crossings between the Leader and the MACD line can serve as early warning signals for momentum shifts.
  • Histogram and Background: The color-coded histogram and background shading provide immediate visual feedback on whether the trend is bullish (above zero) or bearish (below zero), and whether momentum is increasing or decreasing.

Details

This script implements a modified version of the Moving Average Convergence Divergence (MACD) oscillator. Key technical components include:

  • ZLEMA Calculation: The zero-lag effect is achieved by calculating the difference between the current source and the source from a specific lag period, adding it back to the original source before applying an EMA.
  • Laguerre Filter: An optional 4-pole Laguerre filter can be applied to the resulting MACD and Leader lines. This filter is designed to provide significant smoothing while maintaining very low lag compared to traditional moving averages.
  • Leader Logic: The MACD Leader is derived by incorporating a "look-ahead" component (the difference between price and its moving average) into the standard MACD calculation, creating a more proactive signal line.

Settings

Oscillator Settings

  • Fast Length: The period for the shorter-term moving average.
  • Slow Length: The period for the longer-term moving average.
  • Source: The price input used for calculations (e.g., close, hlc3).
  • Signal Smoothing: The period used to smooth the MACD line to create the signal line.
  • MA Type (Oscillator)?: Selection between EMA, ZLEMA, or SMA for the main MACD calculation.
  • MA Type (Signal Line)?: Selection between EMA, ZLEMA, or SMA for the signal line smoothing.

Filtering & Visuals

  • Apply Laguerre Smoothing: Toggles the Laguerre filter on or off for the MACD lines.
  • Laguerre Gamma: Controls the damping factor of the Laguerre filter; higher values result in more smoothing.
  • Draw MACD Leader: Enables or disables the visibility of the sensitive Leader line.
  • Indicate MACD Leader Crossings: Toggles visual plot markers (dots) when the Leader line crosses the MACD line.

FAQ

How do I use the MACD Leader effectively?

The MACD Leader is designed to cross the MACD line before the MACD crosses the signal line. Traders often use these early "Leader" crosses to prepare for upcoming trend changes or to tighten stop-losses.

What is the advantage of ZLEMA over EMA?

ZLEMA reduces the inherent lag found in standard EMAs by adjusting the data for current momentum. This results in an oscillator that tracks price action much more closely, which can be beneficial in fast-moving markets.

How can I access Zero Lag 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.