MACD XD
Jun 29, 2022

The MACD XD indicator provides a comprehensive dual-timeframe momentum analysis by combining two sets of MACD lines and signal lines to identify trend convergences and divergences. It aims to offer traders a clearer view of both short-term momentum and long-term trend direction within a single oscillator window.
Usage
The indicator is designed to help traders identify high-probability entries by looking for alignment between different trend scales.
- Trend Alignment: Users can look for "golden crosses" (bullish) and "death crosses" (bearish) across two different timeframes. A common strategy involves waiting for a signal on the higher timeframe and then using the lower timeframe signals for precise entries.
- Pullback Entries: After a bullish cross on the higher timeframe (green triangle), a bearish cross on the lower timeframe (red triangle) can signal a potential long entry as the price pulls back within the broader uptrend.
- Divergence Analysis: The tool visualizes divergences by connecting peaks of adjacent histogram clusters. This can help identify potential trend reversals when the price action is not supported by the underlying momentum.
- Area Calculation: The indicator calculates the total area of the histogram bars above and below the zero axis, providing quantitative data to support divergence detection.
Details
The script builds upon the standard Moving Average Convergence Divergence (MACD) framework. It calculates the difference between a fast and slow moving average (the MACD line) and then applies a smoothing average (the Signal line) to that result.
Unique to this version is the integration of a secondary, higher-timeframe MACD. This allows for the visualization of "nested" trends. Furthermore, the indicator includes automated peak detection to draw trendlines over the histogram, highlighting when momentum is waning despite price movements.
Settings
Main Inputs
- Fast Length: The period for the shorter moving average used in the MACD calculation.
- Slow Length: The period for the longer moving average used in the MACD calculation.
- Source: The price data used for the calculations (default is Close).
- Signal Smoothing: The period used to average the MACD line to create the signal line.
- Oscillator MA Type: Choose between Simple Moving Average (SMA) or Exponential Moving Average (EMA) for the MACD lines.
- Signal Line MA Type: Choose between SMA or EMA for the signal line smoothing.
FAQ
How do I access the MACD XD indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What do the triangles on the chart represent?
The triangles represent crossovers between the MACD and Signal lines. Red/Blue triangles typically represent the current timeframe (smaller trend), while Green/Orange triangles represent the higher timeframe (bigger trend).
Can I use this for divergence trading?
Yes, the indicator includes specific logic to draw lines connecting histogram peaks and displays numerical values representing the histogram area to assist in identifying momentum divergences.
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.