Heatmap MACD Strategy
Oct 5, 2023

The Heatmap MACD Strategy indicator tracks MACD histogram direction across five customizable timeframes to identify trend alignment and generate automated trading signals.
Usage
The strategy evaluates trend confluence across multiple timeframes to determine entry and exit points. A long position is initiated when all five MACD histograms are simultaneously bullish (above zero). Conversely, a short position is triggered when all five MACD histograms are bearish (below zero).
The strategy includes a dynamic exit mechanism where a trade is closed if any one of the five monitored timeframes changes direction against the current trend. Re-entry occurs only when full alignment across all selected timeframes is restored. Users can customize the analysis by selecting different timeframes or repeating the same timeframe to focus on specific trend durations.
Details
The strategy calculates five independent MACD instances using the security function. It specifically looks at the histogram values to determine market momentum. This approach aims to filter out noise by requiring broad confirmation across different temporal scales, ensuring that trades are only taken when the trend is robust and consistent.
Settings
Timeframes
- First to Fifth Timeframe: Sets the specific time intervals for each of the five MACD calculations.
MACD
- Source: The price source used for MACD calculations (e.g., Close).
- Fast Length: The period for the short-term EMA.
- Slow Length: The period for the long-term EMA.
- Signal Length: The period for the signal line EMA.
Stop Loss
- Use Stop Loss?: Enables or disables the initial stop loss.
- Value: Sets the stop loss distance in pips.
Trailing Stop Loss
- Use Trailing Stop Loss?: Enables or disables a dynamic trailing stop.
- Trailing Stop Loss (pips): The distance maintained from the highest/lowest price reached.
Take Profit 1 & 2
- Value (pips): Target distance for partial and final profit taking.
- Quantity (%): The percentage of the position to close at the first target level.
Break Even
- Use Stop Loss to Breakeven Mode?: Moves the stop loss to entry once a profit threshold is met.
- Value (pips): Profit trigger to move the stop to breakeven.
- Offset (pips): Small buffer added to the breakeven price.
FAQ
How do I use fewer than five timeframes?
If you only want to track three timeframes (e.g., 1H, 2H, 4H), you can set the first three inputs to those values and repeat the 4H setting for the remaining two slots.
What assets is this strategy designed for?
The strategy is versatile and can be applied to Forex, Indices, and Commodities. It includes a pip calculation function that automatically adjusts for JPY pairs, Gold (XAU), and Silver (XAG).
How can I access the Heatmap MACD Strategy?
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.