All indicators

MACD trend heatmap

Nov 22, 2015

Static chart image
SignalsOscillatorsMoving Averages

The MACD trend heatmap indicator visualizes momentum and trend direction directly on the price chart by utilizing classic MACD calculations to generate a comprehensive trend-based heatmap and moving average overlay.

Usage

The indicator can be used to identify trend strength and direction without needing to look at a separate oscillator pane. Traders can observe the color-coded background and moving averages to gauge market sentiment:

  • Moving Averages: The tool plots the internal Fast and Slow EMAs used by the MACD. When the fast EMA is above the slow EMA, it indicates a bullish posture, while the inverse indicates a bearish posture.
  • Heatmap: The background heatmap aggregates multiple MACD signals (MACD line position, histogram slope, signal line crosses) into a layered visual. Darker or more consistent colors suggest stronger trend alignment.
  • Strong Trend Bar Colors: When specific conditions for a "Strong Uptrend" or "Strong Downtrend" are met—where price action, momentum, and the signal line all align—the bars will change color to highlight high-conviction moves.

Details

The script calculates the standard MACD (12, 26, 9) components: the MACD line, Signal line, and Histogram. Rather than plotting these in a sub-window, it analyzes the relationship and rate of change for each component:

  1. Fast/Slow EMA Relationship: Determines the primary trend.
  2. Momentum Slope: Tracks the change in the MACD and Histogram to detect acceleration or deceleration.
  3. Signal Crosses: Integrates the relationship between the MACD and its signal line.

The heatmap is constructed by layering multiple low-opacity background colors, each representing a specific MACD condition. As more conditions align, the background color becomes more saturated.

Settings

MACD Periods

  • Fast Moving Average: The period for the shorter Exponential Moving Average (default: 12).
  • Slow Moving Average: The period for the longer Exponential Moving Average (default: 26).
  • Signal Line: The smoothing period for the MACD signal line (default: 9).

Visual Toggles

  • Enable Bar Color?: Toggles the highlighted bar colors for strong trends.
  • Enable Moving Averages?: Toggles the visibility of the internal EMAs on the chart.
  • Enable Heatmap?: Toggles the multi-layered background trend visualization.

FAQ

How do I interpret the heatmap intensity? The heatmap intensity increases when multiple MACD conditions (such as the histogram being positive AND the MACD line rising) coincide, indicating stronger trend confluence.

What triggers the strong trend bar colors? Strong trend colors trigger when all components (EMAs, MACD slope, Histogram value/slope, and Signal line) align in the same direction simultaneously.

How can I access this indicator? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.