RSI Divergence – Real-Time
Feb 20, 2025

The RSI Divergence – Real-Time indicator identifies bullish and bearish divergences between price action and the Relative Strength Index (RSI) using an adaptive, multi-term detection engine.
Usage
The Usage section describes how traders can interpret the signals provided by the script to identify potential trend reversals or continuations.
- Trend Reversals: Look for Bullish Divergences (green lines/labels) appearing at established support levels and Bearish Divergences (red lines/labels) appearing at resistance zones.
- Trend Continuation: Use divergence signals as a momentum check; a divergence against the trend may suggest a pullback, while a divergence in alignment with the trend can confirm local strength.
- Scalping & Swing Trading: Users can toggle between Short, Medium, and Long-term modes to align the sensitivity of the RSI and pivot detection with their specific trading style.
Details
The script utilizes pivot-based logic to compare price extremes with RSI extremes. It is designed to operate in real-time, meaning it evaluates conditions as they develop rather than waiting for excessive bar closes, which helps reduce lag.
A key feature is the Adaptive RSI Calculation. Instead of a static length, the script can automatically adjust its parameters based on the chart interval:
- Short-Term: Optimized for 1-5 minute charts (RSI 7).
- Medium-Term: Optimized for 15-60 minute charts (RSI 14).
- Long-Term: Optimized for 4-hour charts and above (RSI 28).
In "All-Term" mode, the indicator dynamically selects these settings based on the current timeframe of the chart, ensuring the sensitivity of the divergence detection remains relevant to the price action being viewed.
Settings
Main Settings
- Time Frame: Selects the lookback and RSI length (Short, Medium, Long, or All). "All" adapts automatically to the chart period.
- Symbol Size: Adjusts the visual size of the labels on the chart (Tiny to Huge).
- Show Divergence Labels: Toggles the visibility of the text labels indicating a divergence.
- Bullish/Bearish Divergence Color: Customizes the color of the lines and labels for each divergence type.
- Show Symbols: Toggles the display of the "D" icons on the chart.
FAQ
How do I access RSI Divergence – Real-Time?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Does this indicator repaint?
No, the script is designed for real-time detection based on pivot points. Once a divergence condition is met and the visual is placed, it provides an immediate signal.
What is the best timeframe to use this on?
The indicator is designed to be versatile. Using the "All" setting allows the script to automatically provide the most appropriate RSI length for any timeframe, from 1-minute scalping to daily swing trading.
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.