All indicators

MACD Overlay

Mar 19, 2025

Static chart image
Dynamic OverlaysSignalsOscillatorsMoving Averages

The MACD Overlay indicator provides a visual representation of trend direction and momentum directly on the price chart by converting the classic MACD oscillator into an overlay format. This tool allows traders to identify trend shifts through color-coded moving averages and an optional momentum histogram without needing to look away from price action.

Usage

The MACD Overlay can be used to identify trend direction and potential reversal points. Users should observe the color of the moving averages: a green (Uptrend Color) indicates the Fast EMA is above the Slow EMA, while a red (Downtrend Color) indicates the Fast EMA is below the Slow EMA.

The tool includes a "MACD Multiplier" which allows for higher timeframe analysis on the current chart. For example, setting the multiplier to 2 will double the lengths of the fast, slow, and signal periods, providing a broader trend perspective. Additionally, the "Show Histogram Shade" feature helps visualize momentum; increasing histogram bars suggest growing momentum, while decreasing bars suggest weakening momentum.

Details

This script calculates the MACD line, Signal line, and Histogram using Exponential Moving Averages (EMA). Unlike the traditional oscillator that sits in a separate pane, this implementation projects the values back onto the price chart. The "Zero Line" reference is calculated relative to the Slow MA, allowing the MACD and Signal lines to oscillate around the price action. Users can also enable a "Smooth Source" which applies a weighted moving average to the input price to reduce noise in the calculations.

Settings

MACD Configuration

  • Fast Length: The period used for the shorter-term Exponential Moving Average.
  • Slow Length: The period used for the longer-term Exponential Moving Average.
  • Signal Smoothing: The period used for the signal line EMA calculation.
  • MACD Multiplier: Scales all length inputs to simulate a higher timeframe calculation.

Visuals & Source

  • Show Histogram Shade: Toggles the visibility of the momentum-based histogram shading between the Fast MA and Signal Line.
  • Use Smooth Source: When enabled, uses a smoothed price source (WMA of an SMA) instead of the raw closing price.
  • Uptrend Color: The color used for bullish trend indications.
  • Downtrend Color: The color used for bearish trend indications.

FAQ

How do I use the MACD Multiplier?

The multiplier increases the lookback periods of the MACD components. If your Fast Length is 12 and the multiplier is 2, the indicator will calculate based on a length of 24, effectively showing a slower, higher-timeframe trend.

What does the "Smooth Source" option do?

Enabling this option filters out minor price fluctuations before the MACD calculation occurs, which can result in fewer false signals at the cost of slight lag.

How can I access MACD Overlay?

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.