4 colour MACD with signal line
Jul 14, 2015

The 4 colour MACD with signal line indicator provides a momentum-based oscillating histogram that uses a four-color gradient to highlight both trend direction and strength, complemented by a standard signal line for crossover analysis.
Usage
The indicator can be used to identify trend momentum shifts and potential entry or exit points through the combination of histogram color changes and signal line interactions.
- Histogram Colors: The four colors indicate whether the MACD is above or below the zero line, and whether it is increasing or decreasing compared to the previous bar. Bright green/red indicate strengthening momentum, while faded green/red suggest weakening momentum.
- Signal Line Crossovers: Bullish signals occur when the MACD histogram crosses above the blue signal line, while bearish signals occur when it crosses below.
- Zero Line Crosses: The zero line acts as a baseline; moving above it suggests a long-term bullish shift, while moving below suggests a bearish shift.
Details
The script is a visual enhancement of the standard Moving Average Convergence Divergence (MACD) formula. It calculates the difference between a fast and slow exponential moving average to create the MACD line (displayed here as a histogram). A signal line, which is an EMA of the MACD itself, is plotted over the histogram to provide trigger points for trend changes. The four-color logic is implemented to give traders an immediate visual cue regarding whether the current trend is accelerating or decelerating.
Settings
- Fast moving average: The period used for the shorter-term EMA calculation (default is 12).
- Slow moving average: The period used for the longer-term EMA calculation (default is 26).
- Signal period: The smoothing period used to calculate the signal line (default is 9).
FAQ
How do I interpret the histogram colors? Bright green signifies MACD is above zero and rising; dark green signifies MACD is above zero but falling. Bright red signifies MACD is below zero and falling; dark red signifies MACD is below zero but rising.
Does this indicator provide alerts? Yes, the script includes built-in alerts for MACD/Signal line crossovers and MACD/Zero line crosses.
How can I access the 4 colour MACD with signal line? 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.