MACD with RSI Warning
Sep 20, 2019

The MACD with RSI Warning indicator combines traditional Moving Average Convergence Divergence (MACD) analysis with integrated Relative Strength Index (RSI) overbought and oversold alerts through visual histogram coloring. It allows traders to monitor momentum shifts and potential trend exhaustions within a single oscillator panel, reducing chart clutter while maintaining high situational awareness.
Usage
The indicator functions primarily as a standard MACD, plotting the MACD line, Signal line, and a histogram representing the difference between them. The core utility lies in its adaptive coloring:
- Momentum Analysis: The histogram shows standard green/red shades to indicate bullish or bearish momentum and whether that momentum is increasing (growing) or decreasing (falling).
- RSI Warnings: When the underlying RSI value crosses above the "RSI High Warning" level or below the "RSI Low Warning" level, the histogram columns change to a warning color (yellow by default).
- Strategy Integration: Traders can use this to confirm MACD crossovers. For example, a bullish MACD crossover occurring while the histogram displays an RSI warning may suggest a high-probability reversal or a potentially overextended move.
Details
The script calculates the MACD line using the difference between a Fast and Slow Moving Average (EMA by default, with an option for SMA). The Signal line is then derived as a moving average of the MACD line.
In parallel, the script calculates a 14-period RSI. Rather than plotting the RSI separately, the script evaluates if the RSI value is outside the user-defined boundaries. If the RSI condition is met, the histogram's color logic is overridden by the "Warning" palette, providing an immediate visual cue that the asset is in a technically overextended state according to the RSI.
Settings
- Fast Length: Sets the period for the fast moving average used in the MACD calculation.
- Slow Length: Sets the period for the slow moving average used in the MACD calculation.
- Source: Determines the price data used for the calculations (e.g., Close, Open, HL2).
- Signal Smoothing: The period for the Signal line moving average.
- Simple MA (Oscillator): If enabled, uses SMAs instead of EMAs for the Fast and Slow lengths.
- Simple MA (Signal Line): If enabled, uses an SMA instead of an EMA for the Signal line calculation.
- RSI High Warning: The threshold above which the RSI is considered overbought, triggering the histogram color change.
- RSI Low Warning: The threshold below which the RSI is considered oversold, triggering the histogram color change.
FAQ
How do I interpret the yellow bars in the histogram?
Yellow bars (the default warning color) indicate that the RSI has moved outside of your specified high or low boundaries, suggesting that the current momentum shown by the MACD is occurring during overbought or oversold conditions.
Can I change the moving average type?
Yes, the settings menu includes toggles to switch between Exponential Moving Averages (EMA) and Simple Moving Averages (SMA) for both the MACD oscillator and the Signal line.
How do I access MACD with RSI Warning?
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.