All indicators

Moving Average Convergence Divergence

Oct 22, 2021

Static chart image
SignalsOscillatorsDashboardDivergencesMoving Averages

The Moving Average Convergence Divergence indicator provides a versatile momentum oscillator that tracks the relationship between two exponential moving averages with support for both logarithmic and regular scaling. It is designed to identify trend reversals, momentum shifts, and price-momentum divergences to help traders gauge market strength.

Usage

The Usage section describes how the script can be used to identify trend direction and potential exhaustion points.

Trend Analysis

Traders typically use the relationship between the MACD line (blue) and the Signal line (gray) to determine momentum. When the MACD line crosses above the Signal line, it suggests bullish momentum is increasing. Conversely, a cross below the Signal line indicates bearish momentum. The zero line serves as a baseline; values above zero generally indicate an uptrend, while values below zero indicate a downtrend.

Divergence Detection

The indicator features an automated divergence detection system displayed via a dashboard. A bearish divergence occurs when the asset price moves upward while the MACD trend moves downward, suggesting a potential top. A bullish divergence occurs when the price moves downward while the MACD trend moves upward, suggesting a potential bottom.

Histogram Interpretation

The color-coded histogram represents the distance between the MACD and Signal lines. Bright green or red bars indicate that the distance between the lines is increasing (growing momentum), while faded colors indicate the distance is shrinking (waning momentum).

Details

The script calculates the difference between a Short EMA and a Long EMA. Unique to this version is the inclusion of a Logarithmic scale option. In Logarithmic mode, the MACD is calculated using the difference between the natural logs of the EMAs, which can provide a more normalized view of percentage-based movement rather than absolute price point movement. This is particularly useful for assets with high volatility or significant price appreciation over time.

Settings

  • Scale: Choose between "Logarithmic" or "Regular" calculation methods.
  • Signal: The smoothing period for the Signal line (default is 9).
  • Long: The period for the slower Exponential Moving Average (default is 26).
  • Short: The period for the faster Exponential Moving Average (default is 12).
  • Source: The price data used for calculations (default is Close).

FAQ

How do I read the divergence dashboard?

The dashboard in the top-right corner highlights "Divergence" in green when price action and MACD momentum suggest a bullish reversal, and in red when they suggest a bearish reversal.

What is the advantage of using Logarithmic scale?

The Logarithmic scale accounts for percentage changes rather than fixed price intervals, making the oscillator more consistent across different price levels on long-term charts.

How do I access the Moving Average Convergence Divergence?

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.