MACD Divergence V1
Dec 11, 2020

The MACD Divergence V1 indicator provides a comprehensive visualization of Moving Average Convergence Divergence (MACD) dynamics combined with automated fractal-based divergence detection to identify potential trend reversals and continuations.
Usage
The Usage section describes how the script can be used to identify market shifts through price and oscillator relationships.
- Regular Bullish Divergence: Occurs when price makes a lower low but the MACD line makes a higher low. This suggests waning bearish momentum and a potential upward reversal.
- Regular Bearish Divergence: Occurs when price makes a higher high but the MACD line makes a lower high. This indicates fading bullish momentum and a potential downward reversal.
- Trend Confirmation: The standard MACD line, signal line, and histogram can be used to confirm the overall trend direction and momentum strength alongside the divergence signals.
Details
The indicator calculates the standard MACD line (Fast EMA - Slow EMA) and its Signal line (EMA of the MACD line). Unlike traditional versions that might use the histogram for fractal detection, this version utilizes the MACD line itself to identify high and low fractals.
Fractals are identified using a 5-bar window, where the middle bar must be the highest or lowest relative to the two bars on either side. When a new fractal is confirmed, the script compares the current price and MACD values against the previous fractal to determine if a divergence exists.
Settings
- Source: Determines the price data used for the MACD calculation (e.g., Close, Open, HL2).
- Fast Length: The period for the shorter Exponential Moving Average.
- Slow Length: The period for the longer Exponential Moving Average.
- Smooth Length: The period for the Signal line calculation (EMA of the MACD line).
FAQ
How do I interpret the colored dots on the oscillator?
The colored circles and lines plotted on the MACD line indicate the detection of a fractal that coincides with a regular divergence. Green typically denotes bullish divergence, while red denotes bearish divergence.
What is the difference between this and a standard MACD?
While it includes the standard MACD components, this tool automates the process of finding peaks and troughs (fractals) and mathematically comparing them to price action to highlight divergences that might be missed by the naked eye.
How can I access MACD Divergence V1?
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.