OPEN-SOURCE SCRIPT
Updated Relative Strength Index - Divergences - Libertus

Hello all,
To ease everyone's trading experience I made this script which colors RSI overbought and oversold conditions and as a bonus displays bullish or bearish divergences in last 50 candles (by default, you can change it).
Script is open source, part of code is from Trading View examples. If you have suggestions or you already made some improvements, please report in comment.
Happy trading and good luck!
To ease everyone's trading experience I made this script which colors RSI overbought and oversold conditions and as a bonus displays bullish or bearish divergences in last 50 candles (by default, you can change it).
Script is open source, part of code is from Trading View examples. If you have suggestions or you already made some improvements, please report in comment.
Happy trading and good luck!
Release Notes
New version 2.0 of script. Most of logic is updated and upgraded.Now divergences are shown for whole history.
Be warned that I increased lookback period to 90 bars by default. This is good for time frames up to 4H, even 4H in on the edge here.
Higher time frames then 4H probably need lower lookback period.
Please report any problems you encounter.
Release Notes
TD bugged out when publishing, repeating update.Release Notes
Minor update: Added ability to set alerts per user request.Release Notes
Update:- ability to remove pivots
- ability to display smaller/shorter labels
Release Notes
What new:- adapted script to new pine language version (v4)
- removed 8 n/a value that were cluttering indicator interface next to RSI value (only possible with v4 pine language)
- added option to have colored indicator background instead of BULL/BEAR labels
If you don't want separate indicator for RSI divergences, you can use my RSI Divergences - Candle edition:

If you want OBV divergences script, check out:

Release Notes
Small fix: Pivots didn't hide if you checked both "Hide pivot" and "Color background".Release Notes
Per popular demand, added alerts to pivot high and low.Some code cosmetics.
Release Notes
Added mid line with value 50 separating bullish and bearish momentum.Changed colors for bullish and bearish momentum parts.
If you want to change colors or any value, you can do it in script settings (style part).
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.