MTF MACD 2
Jul 2, 2016

The MTF MACD 2 indicator is a trend-following strategy tool that utilizes multiple timeframe MACD analysis to generate trading signals based on the alignment of short-term, mid-term, and long-term momentum.
Usage
The MTF MACD 2 is used to identify high-probability trade entries by ensuring multiple timeframes are in agreement. A long entry is triggered when the MACD histogram is rising across the long-term, mid-term, and current timeframes simultaneously. Conversely, a short entry is triggered when the histogram is falling across all three.
Users can also enable a trend filter based on the long-term MACD signal line position relative to the zero line. When "Trade On LongTerm Trend Direction" is enabled, long trades are only permitted when the long-term MACD signal is positive, and short trades when it is negative. The script provides visual feedback by coloring the chart bars based on the state of the various timeframe alignments.
Details
The script calculates standard MACD (12, 26, 9) values and uses request.security to fetch data from higher timeframes. To address potential repainting issues common in multi-timeframe indicators, the script includes "Delay Period" settings. By setting these to 1 or higher, the indicator references closed candle data from the higher timeframes, ensuring the signals remain fixed once a bar closes.
Settings
- Long Term Time Frame: Sets the timeframe for the highest level of trend analysis (default is Daily).
- Long Term Delay Period: Determines the offset for higher timeframe data to prevent repainting.
- Mid Term Time Frame: Sets the intermediate timeframe (default is 4-hour).
- Mid Term Delay Period: Determines the offset for mid-term data.
- Trade On LongTerm Trend Direction: When active, filters signals based on whether the long-term MACD signal line is above or below zero.
- Take Profit Percent: Sets the target profit percentage for the built-in strategy.
- Stop Loss Percent: Sets the maximum loss percentage for the built-in strategy.
- Use Take Profit / Stop Loss: Toggles the execution of the percentage-based exit orders.
FAQ
How do I access MTF MACD 2?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
How do I prevent the signals from repainting?
To ensure signals do not change after the bar closes, set the "Long Term Delay Period" and "Mid Term Delay Period" to 1.
Can this be used on lower timeframes like the 3-minute chart?
Yes, the indicator is versatile and can be applied to lower timeframes, provided the higher timeframe settings are adjusted to maintain a logical hierarchy (e.g., using 15m or 1h for higher timeframes when trading on a 3m chart).
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.