RSI Divergence
Jul 1, 2019

The RSI Divergence indicator identifies potential trend reversals by detecting discrepancies between price action and the Relative Strength Index (RSI) momentum.
Usage
The indicator is designed to highlight bullish and bearish momentum shifts. It displays these signals as columns on a separate pane below the price chart.
- Bullish Divergence: Indicated by green columns. This occurs when the RSI shows strength while price reaches a new low or fails to reach a new high relative to the RSI's peak.
- Bearish Divergence: Indicated by red columns. This occurs when price reaches a new high while the RSI shows weakness or fails to reach a new low relative to the RSI's trough.
Traders can use these signals to anticipate exhaustion in the current trend and look for potential entry or exit points.
Details
The script evaluates divergences by comparing the current RSI and price values against their respective highest and lowest values over a lookback period.
It classifies four specific conditions:
- Bullish A: RSI reaches a new high, but the price has not reached a new high.
- Bullish B: Price reaches a new low, but the RSI has not reached a new low.
- Bearish C: Price reaches a new high, but the RSI has not reached a new high.
- Bearish D: RSI reaches a new low, but the price has not reached a new low.
Settings
- RSI Source: Determines the price data used to calculate the RSI (e.g., Close, Open, High, Low).
- RSI Period: Sets the lookback length for the RSI calculation (standard is 14).
- Period: Sets the lookback window used to determine the highest and lowest price/RSI values for divergence detection.
FAQ
How do I interpret the green and red columns?
Green columns represent bullish divergence signals, suggesting a potential upward reversal. Red columns represent bearish divergence signals, suggesting a potential downward reversal.
What timeframes work best for this indicator?
While it can be used on any timeframe, divergence signals are often considered more reliable on higher timeframes (e.g., 1H, 4H, Daily) as they filter out market noise.
How can I access this indicator?
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.