OPEN-SOURCE SCRIPT
RSI(14) Divergence — Regular + Hidden + HTF EMA Filter (pro)

Title:
RSI(14) Divergence — Regular + Hidden + HTF EMA Filter (Scalping Edition)
🔹 Description:
This indicator automatically detects RSI(14) divergences — both Regular (Reversal) and Hidden (Continuation) — and plots them directly on the chart for precision scalping and intraday trading.
It’s optimized for low timeframes (1-minute) such as Bank Nifty, Nifty 50, and Sensex, where spotting early divergence can help confirm short-term momentum shifts.
⚙️ Core Features:
Regular Divergence Detection
Bullish Divergence: Price makes a lower low while RSI makes a higher low → potential reversal upward.
Bearish Divergence: Price makes a higher high while RSI makes a lower high → potential reversal downward.
Hidden Divergence Detection
Hidden Bullish Divergence: Price makes a higher low while RSI makes a lower low → continuation of bullish trend.
Hidden Bearish Divergence: Price makes a lower high while RSI makes a higher high → continuation of bearish trend.
HTF EMA Trend Alignment (Smart Filter)
Optional feature that aligns signals with the higher timeframe (HTF) trend using a 200 EMA.
Example: Only shows bullish divergences when the 5-minute price is above the 5-minute 200 EMA (uptrend alignment).
Helps filter false signals and keeps divergence trading directional.
Chart Visualization
Regular divergences: Bold solid lines (Green for bullish, Red for bearish).
Hidden divergences: Thin dashed lines (Teal for hidden bull, Maroon for hidden bear) — subtle enough to stay unnoticed by casual chart viewers.
Optional labels (“Bull Div”, “Bear Div”, etc.) and minimalistic markers for scalping clarity.
Option to extend divergence lines for future reference.
Custom Alerts (for all divergence types)
Get instant alerts when any regular or hidden divergence is detected.
Works seamlessly for both long and short bias setups.
📈 Recommended Usage:
Timeframe: 1-Minute (Scalping) or 3-Minute (Micro Intraday)
Markets: Bank Nifty, Nifty 50, Sensex, or any high-volatility index/stocks
Combine With:
Higher timeframe structure (H1/H4 bias)
Volume spikes or order block retests
Key support/resistance zones
RSI(14) Divergence — Regular + Hidden + HTF EMA Filter (Scalping Edition)
🔹 Description:
This indicator automatically detects RSI(14) divergences — both Regular (Reversal) and Hidden (Continuation) — and plots them directly on the chart for precision scalping and intraday trading.
It’s optimized for low timeframes (1-minute) such as Bank Nifty, Nifty 50, and Sensex, where spotting early divergence can help confirm short-term momentum shifts.
⚙️ Core Features:
Regular Divergence Detection
Bullish Divergence: Price makes a lower low while RSI makes a higher low → potential reversal upward.
Bearish Divergence: Price makes a higher high while RSI makes a lower high → potential reversal downward.
Hidden Divergence Detection
Hidden Bullish Divergence: Price makes a higher low while RSI makes a lower low → continuation of bullish trend.
Hidden Bearish Divergence: Price makes a lower high while RSI makes a higher high → continuation of bearish trend.
HTF EMA Trend Alignment (Smart Filter)
Optional feature that aligns signals with the higher timeframe (HTF) trend using a 200 EMA.
Example: Only shows bullish divergences when the 5-minute price is above the 5-minute 200 EMA (uptrend alignment).
Helps filter false signals and keeps divergence trading directional.
Chart Visualization
Regular divergences: Bold solid lines (Green for bullish, Red for bearish).
Hidden divergences: Thin dashed lines (Teal for hidden bull, Maroon for hidden bear) — subtle enough to stay unnoticed by casual chart viewers.
Optional labels (“Bull Div”, “Bear Div”, etc.) and minimalistic markers for scalping clarity.
Option to extend divergence lines for future reference.
Custom Alerts (for all divergence types)
Get instant alerts when any regular or hidden divergence is detected.
Works seamlessly for both long and short bias setups.
📈 Recommended Usage:
Timeframe: 1-Minute (Scalping) or 3-Minute (Micro Intraday)
Markets: Bank Nifty, Nifty 50, Sensex, or any high-volatility index/stocks
Combine With:
Higher timeframe structure (H1/H4 bias)
Volume spikes or order block retests
Key support/resistance zones
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.