All indicators

Customizable MACD (how to detect a strong convergence)

Nov 11, 2019

Static chart image
OscillatorsMoving Averages

The MACD Custom Convergence indicator provides a highly flexible version of the classic Moving Average Convergence Divergence oscillator, allowing users to select from 12 different moving average types for the fast, slow, and signal calculations to better identify momentum and trend shifts.

Usage

The Usage section focuses on how to leverage the customizable nature of this tool for trend confirmation and momentum analysis. By adjusting the moving average types, traders can fine-tune the MACD's responsiveness to specific assets and timeframes.

  • Trend Confirmation: Use the relationship between the MACD line and the Signal line. A MACD line above the Signal line (green histogram) suggests bullish momentum, while a MACD line below (red histogram) suggests bearish momentum.
  • Multi-Timeframe Analysis: The indicator includes a built-in timeframe selector, allowing you to view MACD data from higher timeframes (e.g., 1H or 4H) while trading on a lower timeframe (e.g., 15m) to ensure alignment with the broader trend.
  • Convergence Strategy: This tool is best used as a momentum filter. For example, a trader might look for a bullish MACD crossover that converges with a breakout above a key resistance level or a trendline.

Details

The script executes a standard MACD calculation ($Fast MA - Slow MA$) but replaces the static Exponential Moving Average (EMA) with a selectable list of smoothing methods. The inclusion of advanced averages like the Hull Moving Average (HullMA), Double EMA (DEMA), and Correlation Trend Indicator (CTI) allows for significantly reduced lag compared to the traditional MACD. The multi-timeframe component utilizes request.security to fetch data, providing a macro perspective of momentum without switching charts.

Settings

Timeframe Settings

  • Use Current Chart Resolution?: When enabled, the indicator uses the timeframe of the current chart.
  • Use Different Timeframe?: If the above is disabled, specify a custom timeframe (e.g., "60" for hourly) to fetch MACD data.

MA Configuration

  • Type of Fast/Slow/Signal MA: Choose the calculation method (SMA, EMA, WMA, RMA, VWMA, SMMA, KMA, TMA, HullMA, DEMA, TEMA, or CTI).
  • Fast MA Length: The period for the shorter-term moving average (default is 12).
  • Slow MA Length: The period for the longer-term moving average (default is 26).
  • Signal MA Length: The period for the smoothing of the MACD line to create the Signal line (default is 9).

FAQ

How do I use the different moving average types?

You can experiment with different combinations in the settings menu. For example, using a DEMA or HullMA for the fast and slow components can result in a much faster response to price changes than the standard EMA-based MACD.

What is the benefit of the multi-timeframe feature?

It allows you to detect momentum "convergences." If the daily MACD is bullish and the 1-hour MACD also turns bullish, it provides a higher probability signal than looking at a single timeframe in isolation.

How can I access this tool?

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.