Multi Timeframe MACD
Mar 29, 2015

The Multi Timeframe MACD indicator provides a comprehensive view of momentum across various time intervals by overlaying multiple MACD calculations onto a single oscillator pane. This allows traders to identify trend alignment and potential reversals by observing how higher timeframe momentum compares to the current chart interval.
Usage
The Multi Timeframe MACD can be used to confirm trends and find confluence between different periods. Traders typically look for scenarios where the current timeframe MACD is moving in the same direction as the higher timeframe gray lines.
- Trend Confirmation: When multiple gray lines (higher timeframes) and the blue line (current timeframe) are all above the zero line, it suggests a strong bullish environment.
- Divergence Identification: Differences in the direction between the higher timeframe lines and price can signal weakening momentum on a broader scale.
- Visual Hierarchy: The current timeframe is highlighted in blue, while higher timeframes (5m, 15m, 30m, 1h, 2h, and 4h) are displayed in varying shades of gray to provide a clear visual depth.
Details
The script calculates the difference between a fast and slow exponential moving average (EMA) to derive the raw MACD value. For higher timeframe calculations, it utilizes the request.security function to fetch data from intervals up to 4 hours.
To ensure the higher timeframe data is smooth and representative when projected onto lower timeframe charts, the script applies a Simple Moving Average (SMA) smoothing factor that scales relative to the timeframe being analyzed. Note that higher timeframe lines are only visible when the chart's current interval is lower than the target timeframe to maintain technical relevance.
Settings
- Fastline: Determines the period for the fast EMA calculation (default is 12).
- Slowline: Determines the period for the slow EMA calculation (default is 26).
- Smoothing: Sets the base smoothing factor applied to the MACD results.
- Source: Specifies the price data used for the calculations (e.g., Close, Open, HL2).
- Show [Timeframe]: Toggle visibility for specific timeframe lines (5m, 15m, 30m, 1h, 2h, 4h).
FAQ
How do I use the Multi Timeframe MACD?
You can use it to spot momentum alignment; if the current timeframe MACD and the higher timeframe lines are all trending in the same direction, it indicates high-probability trend strength.
Why are some lines not appearing on my chart?
The script is designed to only show higher timeframe data. If your current chart is set to a 1-hour interval, the 5m, 15m, and 30m lines will automatically be hidden to ensure logical consistency.
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.