All indicators

MACD Histogram with Line and Midpoint (9,30, close,9)

Jul 29, 2018

Static chart image
SignalsOscillatorsDivergences

The MACD Histogram with Line and Midpoint (9,30, close,9) indicator provides a specialized perspective on trend momentum and market structure by utilizing a modified MACD calculation often associated with the TRI methodology.

Usage

This tool is primarily used to identify momentum shifts and structural changes in price action. Unlike the standard 12,26 MACD settings, this version defaults to 9 and 30, offering a different sensitivity to market cycles.

  • Histogram Analysis: The central feature is the histogram, which represents the difference between the MACD line and the signal line. Users can monitor the expansion and contraction of these bars to gauge momentum.
  • Trend Coloring: By enabling the "Color by trend" setting, the histogram changes color based on whether the MACD is above or below the zero line, providing an immediate visual cue of the primary trend direction.
  • Structure Outline: The "Outline structure" feature adds a line following the histogram's path, helping traders visualize the "wave" patterns of momentum more clearly.
  • Divergence Detection: The indicator can highlight potential reversals by identifying bullish and bearish divergences between price action (linear regression) and the MACD histogram.

Details

The script is based on concepts taught in the TRI Level 1 program. It calculates the MACD line as the difference between a fast EMA (9) and a slow EMA (30). A signal line is then derived using an EMA of the MACD line (smoothing of 9).

A unique implementation detail is the inclusion of a "Structure Line," which is a 1-period SMA of the histogram. This acts as a visual boundary for the momentum bars. The divergence logic uses linear regression of price compared to the rising or falling state of the histogram over a defined candle lookback period.

Settings

General Settings

  • Fast MA periods: Sets the length for the faster Exponential Moving Average (default is 9).
  • Slow MA periods: Sets the length for the slower Exponential Moving Average (default is 30).
  • Color by trend: When enabled, the histogram bars are colored green when MACD > 0 and red when MACD < 0.
  • Outline structure: Toggles the visibility of the line that tracks the top of the histogram bars.
  • Show MACD line: Toggles the visibility of the primary MACD line.
  • Show Signal line: Toggles the visibility of the signal line.
  • Show divergences: Enables background highlighting for detected bullish and bearish divergences.
  • Candles for div: Specifies the lookback period used for detecting momentum divergences.
  • Smoothing periods: Sets the length for the signal line calculation (default is 9).

FAQ

How do I interpret the divergence highlights?

A green background indicates a bullish divergence (price falling while momentum rises), while a red background indicates a bearish divergence (price rising while momentum falls).

Can I change the sensitivity of the indicator?

Yes, by adjusting the Fast and Slow MA periods in the settings, you can make the indicator more responsive to short-term moves or smoother for long-term trends.

How can I access this tool?

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.