MACD Multi Time Frame
Jan 27, 2020

The MACD Multi Time Frame indicator provides a non-repainting Moving Average Convergence Divergence (MACD) calculation from higher timeframes, allowing traders to monitor broader trend momentum without switching charts.
Usage
The MACD Multi Time Frame tool is used to identify trend direction and momentum shifts on a higher timeframe (HTF) directly from your current chart. By default, it operates in "Auto" mode, which selects a logical higher timeframe based on your current interval. Alternatively, you can manually define a specific timeframe to track.
Traders use this indicator to:
- Identify Major Trends: Observe the MACD line and Signal line relationship on a higher timeframe to ensure trades align with the dominant trend.
- Momentum Analysis: The histogram highlights whether HTF momentum is accelerating or decelerating through color-coded columns.
- Crossovers: Signal line crossovers on the HTF can serve as confirmation for entries or exits on lower timeframes.
Details
This script is designed to be non-repainting by utilizing request.security with specific indexing and the lookahead parameter correctly configured to ensure that higher timeframe data is projected onto the chart only after the HTF bar has closed.
The indicator calculates the standard MACD components—the MACD Line (difference between fast and slow EMAs), the Signal Line (EMA of the MACD Line), and the Histogram (difference between the MACD and Signal lines). These values are calculated using data from the requested timeframe and plotted as a classic oscillator.
Settings
HTF Mode
- HTF Mode: Switches between "Auto" (automatic timeframe selection) and "User Defined" (manual selection).
- Resolution: Specifies the timeframe to be used if "User Defined" mode is active.
MACD Parameters
- Fast Length: The period for the shorter Exponential Moving Average (default is 12).
- Slow Length: The period for the longer Exponential Moving Average (default is 26).
- Signal Smoothing: The period for the EMA of the MACD line (default is 9).
- Source: The price data used for the calculation (default is Close).
FAQ
How do I access MACD Multi Time Frame?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Why is the MACD different from the standard indicator?
Because this version displays data from a higher timeframe. For example, if you are on a 15-minute chart, it might be displaying the MACD data for the 1-hour timeframe.
Does this indicator repaint?
No, the script is constructed to ensure that higher timeframe data is only plotted once the respective HTF bar is completed, avoiding the common repainting issues associated with multi-timeframe scripts.
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.