RSI Divergence Strategy

Jun 12, 2025

Static chart image
Signals
Oscillators
Divergences

The RSI Divergence Strategy indicator identifies high-probability trading opportunities by combining Relative Strength Index (RSI) levels with bullish and bearish divergence signals.

Usage

The script is designed to automate or signal entries and exits based on the convergence of momentum oscillators and price action.

  • Long Trades: A long entry is triggered when a bullish divergence is identified (price making lower lows while RSI makes higher lows) and the RSI value is below the user-defined "Long Entry RSI" level.
  • Short Trades: A short entry is triggered when a bearish divergence is identified (price making higher highs while RSI makes lower highs) and the RSI value is above the "Short Entry RSI" level.
  • Exits: Positions are closed when the RSI reaches the designated "Long Exit" or "Short Exit" levels, regardless of divergence.

The tool includes visual aids such as divergence labels (BULL/BEAR), dotted lines connecting RSI pivots, and background coloring to indicate overbought (red), oversold (green), and neutral (gray) zones.

Details

This strategy utilizes pivot-based divergence detection. It looks back over a specific window (defined by lookback constants in the code) to compare price pivots with RSI pivots. By requiring the RSI to be at specific extreme levels when a divergence occurs, the script filters out weak signals that might appear in the middle of a range. The logic ensures that trades are only initiated when momentum shows a clear exhaustion pattern at key exhaustion levels.

Settings

RSI Settings

  • RSI Length: Determines the lookback period for the RSI calculation (default is 14).
  • Source: The price data used to calculate the RSI (typically "close").
  • Calculate Divergence: Enables or disables the divergence detection logic and visual markers.

RSI Levels

  • Long Entry RSI: The maximum RSI value allowed for a long entry to trigger alongside a bullish divergence.
  • Short Entry RSI: The minimum RSI value allowed for a short entry to trigger alongside a bearish divergence.
  • Long Exit RSI: The RSI level at which a long position will be closed.
  • Short Exit RSI: The RSI level at which a short position will be closed.

FAQ

How do I access RSI Divergence Strategy?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Can I use this strategy on any timeframe?

Yes, the strategy is functional on all timeframes. However, users should adjust the RSI Entry/Exit levels based on the specific volatility and behavior of the asset on that timeframe.

Does this indicator support automated trading?

Yes, the strategy includes built-in alert conditions for divergences and entry signals, which can be connected to webhook-compatible platforms for automation.

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.