RSI Divergence (Regular + Hidden)

Nov 21, 2025

Static chart image
Signals
Oscillators
Dashboard
Divergences
Pivot Based (Retrospective)

The RSI Divergence (Regular + Hidden) indicator is a comprehensive visual analysis tool that identifies four distinct types of divergence between price action and the Relative Strength Index (RSI). It aims to highlight potential trend exhaustion or continuation by tracking confirmed swing highs and lows on both the price chart and the RSI oscillator.

Usage

The script is designed for visual confirmation of price-momentum discrepancies. It detects:

  • Regular Bullish Divergence: Occurs when price makes a lower low while RSI makes a higher low. This often suggests weakening bearish momentum.
  • Regular Bearish Divergence: Occurs when price makes a higher high while RSI makes a lower high, suggesting weakening bullish momentum.
  • Hidden Bullish Divergence: Occurs when price makes a higher low but RSI makes a lower low, often studied as a sign of trend continuation in an uptrend.
  • Hidden Bearish Divergence: Occurs when price makes a lower high but RSI makes a higher high, often viewed as a sign of trend continuation in a downtrend.

Users can toggle the visibility of regular and hidden divergences separately to focus on specific market structures.

Details

The indicator utilizes the ta.pivothigh() and ta.pivotlow() functions to define swings. To ensure signals are stable and do not repaint, a divergence is only plotted once a pivot is fully confirmed based on the "Right Swing Bars" parameter. The script tracks the two most recent confirmed pivots for both price and RSI, applying a minimum bar distance filter to reduce noise and ensure the divergence is meaningful over a specific time window.

Settings

RSI Settings

  • RSI Source: Determines the price data used for the RSI calculation (default is Close).
  • RSI Length: Sets the period for the RSI calculation (default is 14).

Swing / Pivot Settings

  • Left Swing Bars: The number of bars required to the left of a candle for it to be considered a pivot.
  • Right Swing Bars: The number of bars required to the right to confirm a pivot. Higher values result in more lag but more significant swing points.

Divergence Filters

  • Min Bars Between Swings: The minimum horizontal distance required between two pivots to qualify for divergence.
  • Min RSI Difference: The minimum vertical distance required between the two RSI pivot values to filter out minor fluctuations.

Visibility & Alerts

  • Show Regular/Hidden Divergence: Toggles for different divergence types.
  • Show Lines/Labels: Toggles for the visual drawings on the chart.
  • Enable Alerts: Activates the built-in alert conditions for all four divergence types.

FAQ

How do I access the RSI Divergence (Regular + Hidden) indicator?

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 indicator waits for the "Right Swing Bars" to close to confirm a pivot point before identifying and drawing the divergence, ensuring the signals are stable on historical data.

Can I use this for automated trading signals?

While the script includes alerts, it is designed primarily as a visual analysis tool. Traders typically use these signals in conjunction with other technical analysis methods like support/resistance levels and trend filters.

Free access on the following platforms
tradingviewSymbolTradingView
ninjatraderNinjaTrader
metatrader4MetaTrader 4/5
thinkorswimThinkorswim

Unlock Unlimited Access to the LuxAlgo Library

Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.

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.