All indicators

Color Changing MACD

May 22, 2023

Static chart image
SignalsOscillatorsMoving Averages

The Color Changing MACD indicator provides a visual representation of trend strength and momentum shifts by dynamically adjusting its color based on the relationship between the MACD and Signal lines. It aims to help traders identify the beginning, advancing, and ending phases of a trend by monitoring the expansion and contraction of the histogram range.

Usage

The indicator is used to identify trend phases through color-coded visual cues on the MACD and Signal lines, as well as the background fill:

  • Bullish Trend Continuation (Green): When the MACD is above the Signal line and the histogram is expanding (greater than the previous bar), indicating increasing bullish momentum.
  • Bearish Trend Continuation (Red): When the MACD is below the Signal line and the histogram is expanding (lower than the previous bar), indicating increasing bearish momentum.
  • Trend Weakening (Purple): When the range between the MACD and Signal line narrows, suggesting that the current trend may be coming to an end or entering a consolidation phase.

The tool also features visual markers for Golden Crosses (bullish) and Death Crosses (bearish) to highlight potential entry or exit points.

Details

The Moving Average Convergence Divergence (MACD) is derived from the difference between two moving averages. Traditionally, trends progress as these averages diverge and lose steam as they converge. This script automates the visualization of this convergence and divergence:

  • Expansion: Suggests a healthy, advancing trend phase.
  • Contraction: Often precedes a trend reversal or a period of range-bound movement. The script allows for customization of the Moving Average types (SMA or EMA) for both the oscillator and the signal line, providing flexibility for different market conditions.

Settings

Common

  • Fast Length: Sets the period for the fast moving average.
  • Slow Length: Sets the period for the slow moving average.
  • Source: Determines the price data used for calculations (e.g., Close, Open, HL2).
  • Signal Smoothing: Sets the period for the Signal line calculation.
  • Oscillator MA Type: Choose between SMA or EMA for the MACD line components.
  • Signal Line MA Type: Choose between SMA or EMA for the Signal line smoothing.
  • Show GC/DC Signals?: Toggles the visibility of triangle markers for Golden and Death crosses.

Color Settings

  • MACD Line: Customizes the base color of the MACD line.
  • Signal Line: Customizes the base color of the Signal line.

Histogram

  • Above Grow/Fall: Adjusts the colors and transparency for the histogram when it is above the zero line.
  • Below Grow/Fall: Adjusts the colors and transparency for the histogram when it is below the zero line.

FAQ

How do I use the Color Changing MACD to find reversals?

Look for the color to change to purple while the histogram is at an extreme. This indicates that the distance between the MACD and Signal lines is narrowing, which often happens before a crossover occurs.

Can I set alerts for crossovers?

Yes, the indicator includes built-in alert conditions for Golden Crosses, Death Crosses, and histogram direction changes (Turning Up or Turning Down).

How do I access Color Changing MACD?

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.