MACD HTF - Dynamic Smoothing
Aug 17, 2023

The MACD HTF - Dynamic Smoothing indicator provides a higher timeframe (HTF) view of the Moving Average Convergence Divergence (MACD) while applying dynamic smoothing to ensure a clean, step-free visualization on lower timeframe charts.
Usage
The Usage section describes how the script can be used to monitor trend momentum and potential reversals from a higher-level perspective without the visual "staircase" effect common in multi-timeframe indicators.
- Trend Identification: Use the HTF MACD line and Signal line relationship to determine the dominant market trend. A MACD line above the Signal line generally suggests bullish momentum, while a position below suggests bearish momentum.
- Smoothing Interpretation: The indicator automatically calculates a smoothing factor based on the ratio between the current chart timeframe and the selected HTF. This ensures that the plots remain fluid and responsive even when viewing significantly higher timeframes.
- Signal Execution: Bullish and bearish circles appear on the MACD line when a crossover occurs. Specifically, a long signal is plotted when the MACD crosses above the Signal line below the zero level, and a short signal is plotted when it crosses below the Signal line above the zero level.
Details
This tool implements the standard MACD calculation—the difference between a fast and slow moving average—but expands its utility by allowing users to select different moving average types beyond the standard EMA.
The dynamic smoothing is achieved by calculating the ratio between the requested higher timeframe and the chart timeframe in minutes. This ratio is then used as the length for a Simple Moving Average (SMA) applied to the requested data, which removes the jagged "steps" that typically occur when plotting data from a higher resolution onto a lower one.
Settings
Higher Time Frame MACD Settings
- MA type: Select the base moving average calculation used for the MACD and Signal lines (options include EMA, SMA, DEMA, TEMA, WMA, and HMA).
- Higher Time Frame: Sets the resolution from which the MACD data is derived.
- Fast MA Length: The lookback period for the shorter moving average.
- Slow MA Length: The lookback period for the longer moving average.
- Length Signal MA: The lookback period for the Signal line calculation.
- Plot Signal?: Toggles the visibility of the entry signal circles on the MACD line.
FAQ
How do I access MACD HTF - Dynamic Smoothing?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Why does the MACD look different on different chart timeframes?
The indicator uses dynamic smoothing based on your current chart resolution. As you switch timeframes, the smoothing factor adjusts to maintain a fluid line relative to the requested higher timeframe.
Can I use this for automated alerts?
Yes, the script includes alert conditions for MACD crossovers/crossunders and Zero Line breaches, which can be configured via the TradingView alerts menu.
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.