MTF MACD Bar
Aug 17, 2022

The MTF MACD Bar indicator is a multi-timeframe tool designed to simplify the interpretation of Moving Average Convergence Divergence (MACD) by visualizing trend direction as a color-coded bar. It allows traders to quickly identify whether the MACD is in a bullish or bearish state across different timeframes without cluttering the main price chart.
Usage
The indicator is used to identify trend alignment between the current chart and higher timeframes. Because it represents the MACD state as a continuous bar, it provides an immediate visual cue for decision-making.
- Bullish State: When the MACD line is above the signal line, the bar turns green. A solid green indicates the momentum is expanding, while a semi-transparent green suggests the margin between the lines is narrowing.
- Bearish State: When the MACD line is below the signal line, the bar turns red. A solid red indicates expanding bearish momentum, while a semi-transparent red suggests the margin is narrowing.
Traders can use this to ensure they are trading in the direction of a higher-timeframe trend (e.g., viewing Daily MACD status while trading on a 15-minute chart).
Details
The script utilizes the request.security function to fetch MACD data from a user-defined timeframe. It calculates the standard MACD line, signal line, and histogram based on the fast, slow, and smoothing inputs.
The color logic is determined by two factors:
- Trend Direction: Whether the MACD line is above or below the signal line.
- Momentum Intensity: The script calculates the "margin" (the difference between the MACD and Signal lines). If the current margin is greater than the previous bar's margin, the color is more opaque, indicating increasing momentum.
Settings
- MTF: Sets the timeframe from which the MACD data is pulled (e.g., Daily, Weekly, Monthly).
- Fast Length: The period for the shorter-term Exponential Moving Average (default is 12).
- Slow Length: The period for the longer-term Exponential Moving Average (default is 26).
- Signal Smoothing: The period for the Exponential Moving Average of the MACD line (default is 9).
FAQ
How do I interpret the colors of the MTF MACD Bar?
A green bar indicates a bullish MACD crossover (MACD > Signal), while a red bar indicates a bearish cross (MACD < Signal). Bright/opaque colors represent increasing momentum, while faded colors represent waning momentum.
Can I set alerts for crossovers?
Yes, the script includes alert conditions for both Bullish MACD Crossovers and Bearish MACD Crossunders, which can be configured to trigger on the selected timeframe.
How do I access MTF MACD Bar?
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.