OPEN-SOURCE SCRIPT
Capiba Custom RSI with Divergences v2

🇬🇧 English
Summary
This indicator is an enhanced and customizable version of the classic RSI, designed to provide clearer and more powerful trading signals. It combines an alternative, more price-sensitive RSI calculation with an automatic divergence detection, which is one of the most effective tools for predicting trend reversals and finding high-probability entry and exit points.
Built upon the compilation of knowledge and open-source codes from the community, this script has been refined to be an all-in-one tool for traders who base their strategies on momentum and trend exhaustion.
Key Features and How to Use
Ultimate RSI and Signal Line (Momentum)
What it is: The main indicator (white line) is an RSI variation that reacts more dynamically to changes in price volatility. It is accompanied by a signal line (orange, by default), which is a moving average of the RSI itself, serving to smooth the indicator and generate crossover signals.
How to use for Entries/Exits:
Buy Signal (Short-Term): Crossover of the RSI line (white) above the signal line (orange).
Sell Signal (Short-Term): Crossover of the RSI line (white) below the signal line (orange). These are momentum signals, ideal for confirming a trend or for scalping.
Automatic Divergence Detection (Reversal Signals) This is the most powerful feature of the indicator. A divergence occurs when the price moves in one direction and the momentum indicator moves in the opposite direction, signaling a likely exhaustion of the current trend.
Bullish Divergence (Green Line):
What it is: The price makes a lower low, but the RSI makes a higher low.
Meaning: Selling pressure is decreasing. It is a strong signal of a potential market bottom and an excellent entry opportunity for a long position.
Bearish Divergence (Red Line):
What it is: The price makes a higher high, but the RSI makes a lower high.
Meaning: Buying pressure is losing strength. It is a strong signal of a potential market top and an excellent exit opportunity for a long position or an entry for a short position.
Customizable Overbought & Oversold Levels
The horizontal lines (default 80 and 20) and the colored areas show when the asset is overextended to the upside (overbought) or downside (oversold), helping to contextualize the divergence and crossover signals.
Recommended Strategy
For maximum effectiveness, combine the signals:
High-Probability Entry (Buy): Look for a Bullish Divergence (green line) forming in the oversold zone. Confirm the entry when the RSI line crosses above its signal line.
High-Probability Exit (Sell): Look for a Bearish Divergence (red line) forming in the overbought zone. Confirm the exit or new short entry when the RSI line crosses below its signal line.
Acknowledgements
This indicator was developed by compiling and customizing excellent open-source ideas and codes shared by the TradingView community. Special thanks to everyone who contributes to the advancement of technical analysis.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.