Regular and hidden RSI divergence
Compare two lows for bullish patterns and two highs for bearish patterns. Regular divergence questions the current move; hidden divergence is a continuation hypothesis within an existing trend. Neither supplies an entry price or a forecast by itself.
| Pattern | Price | Paired RSI | Hypothesis to test |
|---|---|---|---|
| Regular bullish | Lower low | Higher low | Possible upward reversal |
| Regular bearish | Higher high | Lower high | Possible downward reversal |
| Hidden bullish | Higher low | Lower low | Possible uptrend continuation |
| Hidden bearish | Lower high | Higher high | Possible downtrend continuation |
TradingView describes the regular bullish and bearish relationships in its RSI reference. Its Cardwell discussion describes the price/RSI structures commonly called hidden divergence as positive and negative reversals. The label does not establish a trading edge.
Define the pivot pair before drawing the line
An RSI divergence indicator needs an explicit pairing rule. The following is an illustrative specification for a custom indicator, not the algorithm used by the scanner above or a recommended parameter set.
- Use one symbol and timeframe, with RSI length 14 calculated from closing prices. Define price pivots from candle lows and highs, rather than mixing closes with wick extremes.
- Require three bars on each side of a price pivot. For lows, require the candidate low to be strictly below all six surrounding lows; reject ties. Reverse the comparison for highs.
- Read RSI on each price-pivot candle. Compare consecutive confirmed lows or consecutive confirmed highs. These sampled RSI values do not have to be separate RSI pivots.
- Accept pairs separated by 5 to 60 bars, measured between pivot candles. Reject pairs outside that range instead of searching backward for a more attractive match. Require strict price and RSI inequalities.
An alternative is to detect price and RSI pivots separately. That method needs a maximum matching distance, a tie-break rule and a ban on reusing one oscillator pivot for several price pivots. It must also wait until both members are confirmed. Results from the two methods are not interchangeable.
Confirmation happens after the pivot candle
In the illustrative three-right-bar rule, a low on bar 100 becomes known only at the close of bar 103 if the intervening conditions hold. An alert belongs on bar 103. Moving the visual marker back to bar 100 does not make the signal available three bars earlier.
TradingView documents this delay in its pivot example and explains the risk of historical backfilled markers in Repainting. Confirmed-bar checks address intrabar changes, but do not eliminate data revisions or errors in higher-timeframe requests. Keep the detection timestamp visible when evaluating a script.
A bullish divergence that does not reverse
Hypothetical example: confirmed price lows fall from 100 to 96 while RSI on those candles rises from 24 to 29. That satisfies regular bullish divergence under a price-pivot sampling rule. Suppose the intervening swing high is 103 and the later bounce reaches only 101 before price falls to 93. Momentum weakened on the second low, but the downtrend continued.
A test could require a close above 103 before entry, expire the setup after ten bars, and invalidate it on a break below 96. Those are illustrative rules, not measured improvements. Record rejected signals as well as completed trades, apply fees and slippage, and start any simulated decision after the signal becomes available. TradingView's divergence guidance warns against relying on divergence alone.
What this scanner can and cannot tell you
The tool compares the minimum and maximum closing prices and RSI values in two halves of a 20-observation window. It finds each extreme independently, so price and RSI may come from different dates. Treat a result as a candidate to inspect on a chart, not evidence that the pivot specification above has been met.
The universe is limited to up to 50 stocks from the most-active feed. Missing or failed RSI requests are omitted. The daily data is not a streaming intraday alert service, and the strength score is not a win probability. Applying filters can reuse the already loaded scan; changing the RSI period does not necessarily recalculate those cached results. Verify the chart settings before acting on a row.
Turn the rule into a reviewable indicator
Give Pineify's AI Coding Agent the RSI source, pivot width, pairing method, spacing limits and alert timing. Ask it to show both pivot and detection timestamps, and review the generated Pine Script in TradingView. Check a rejected pair, a tied low and a live unconfirmed bar before trusting the labels.
For basic RSI calculations, use the RSI calculator. Comparing momentum with price differs from SMT divergence, which compares related instruments. Browse the TradingView indicator guides for other momentum and trend tools.
Sources checked October 16, 2026. Educational information only, not investment advice. Scanner matches and illustrative rules do not guarantee reversals or profitable trades.