vitelot

Divergence Detector

vitelot Updated   
This indicator is meant to trigger your attention to possible regular divergences.
As soon as the indicator prints a red or green background, a bearish or bullish regular divergence could have formed.
The divergence is determined between the close values of price and the corresponding values of the underlying plotted baseline indicator.
As baseline, you can use RSI, CCI, MACD, RVI, and OBV.
For each of them, you can tune their classical parameters.
They are initially set to the default periods:
RSI(14), CCI(14), MACD(12,26), RVI(10). OBV has no params.
The detection algorithm uses a tunable window length at a default optimal value of 21.

I would classify this indicator as advanced, and I suggest its use by experienced traders only.
Divergences can be extremely profitable but can destroy your account if you are not cautious. When the indicator detects a possible divergence be sure to check with your eyes. In fact, sometimes a spurious divergence is signalled because of the finite window size.

The algorithm I use in this indicator is brand new and based on a simple but tricky concept. I'm still working to refine it such to detect hidden divergences as well.

This indicator can be used on any TF, *BUT* be sure to use a volume filter for TF under H1, such to avoid low volume periods (e.g., during the Asian range).
You could find my "Volume Volatility Spectrum" or "ATR volatility spectrum" well suited for that purpose.

I've seen a multitude of paid indicators for detecting divergences, some of them not cheap at all. This one is free and it works fairly well! Enjoy it, and use it at your own risk.
Release Notes:
corrected an error due to redefinition of obv function, which triggered after the obv function was added to the TV standard library
Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
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.

Want to use this script on a chart?