MACD Trend Candles
Nov 23, 2020

The MACD Trend Candles indicator provides a comprehensive visualization of trend momentum and overbought/oversold conditions by mapping MACD histogram data and Stochastic RSI signals directly onto the price chart.
Usage
The script is designed for trend-following strategies, particularly in trending markets. It combines three distinct components to assist in decision-making:
SMA Trend Channel
The channel is formed by the 20-period SMA of the high and low prices.
- Uptrend: Price closing consistently above the channel suggests strong bullish momentum.
- Downtrend: Price closing consistently below the channel suggests strong bearish momentum.
- Entries: Traders may look for aggressive entries when price closes inside the channel from the opposite side, or conservative entries when price breaks out of the channel.
MACD Candle Coloring
Candles are colored based on the MACD histogram state to show momentum shifts:
- Dark Green: MACD histogram is positive and increasing (strong bullish momentum).
- Light Green: MACD histogram is positive but decreasing (weakening bullish momentum).
- Dark Red: MACD histogram is negative and decreasing (strong bearish momentum).
- Light Red: MACD histogram is negative but increasing (weakening bearish momentum).
Stochastic RSI Diamonds
Diamonds appear above or below candles to indicate extreme conditions:
- Upper Diamond: Both %K and %D lines of the Stoch RSI are above 80, indicating overbought conditions.
- Lower Diamond: Both %K and %D lines are below 20, indicating oversold conditions.
- Divergence Spotting: If a new price high occurs without a diamond where a previous high had one, it may signal a bearish divergence.
Details
The script integrates three popular technical analysis concepts into a single overlay. By using a 20-period SMA channel on High/Low prices, it creates a "no-trade zone" or a baseline for trend transitions. The MACD calculation uses the standard 12, 26, 9 settings by default but allows for switching between EMA and SMA for the oscillator and signal line components. The Stochastic RSI provides a secondary layer of confirmation for momentum exhaustion.
Settings
SMA Channel
- SMA Channel Length: The lookback period for the high and low moving averages.
- SMA Source High/Low: The price source used for the upper and lower bands of the channel.
MACD
- Fast/Slow Length: Periods used for the MACD oscillator calculation.
- MACD Source: Price source for the MACD calculation.
- Signal Smoothing: The period used for the MACD signal line.
- Simple MA (Oscillator/Signal): Toggles between Simple Moving Average and Exponential Moving Average for the respective components.
Stoch-RSI
- Smooth K/D: Smoothing periods for the Stochastic RSI lines.
- RSI/Stoch Length: Lookback periods for the RSI and Stochastic calculations.
- RSI Source: Price source used for the RSI input.
FAQ
How do I interpret the candle colors?
Green candles represent bullish MACD momentum, while red candles represent bearish momentum. Darker shades indicate that the momentum is currently accelerating in that direction, while lighter shades indicate deceleration.
Can this be used on Heikin Ashi candles?
Yes, the script works effectively on standard OHLC candles and Heikin Ashi candles, providing a smoother visualization of the trend when used with the latter.
How can I access MACD Trend Candles?
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.