To ease everyone's trading experience I made this script which colors overbought and oversold conditions and as a bonus displays or 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!
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.
- ability to remove pivots
- ability to display smaller/shorter labels
- 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:
Some code cosmetics.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.