OPEN-SOURCE SCRIPT
Continuous Divergence

Divergence is generally measured on the RSI and limited to finding either:
1. higher highs on the price and lower highs on the RSI (bearish divergence)
2. lower lows on the price and higher lows on the RSI (bullish divergence)
Continuous Divergence (CD) does two things differently. Firstly, it uses the MFI as its primary source of data, due to its volume component giving it higher accuracy. Secondly, it doesn't measure discrete divergence - i.e. between peaks and troughs - but rather a continuous divergence measurement.
Essentially it is measuring at any given time, the correlation between the price and the MFI. This is smoothed with a moving average (configurable) to get cleaner lines.
CD is used to detect both a slowing down of momentum on the current trend, and a reversal of trend due to changing momentum.
1. higher highs on the price and lower highs on the RSI (bearish divergence)
2. lower lows on the price and higher lows on the RSI (bullish divergence)
Continuous Divergence (CD) does two things differently. Firstly, it uses the MFI as its primary source of data, due to its volume component giving it higher accuracy. Secondly, it doesn't measure discrete divergence - i.e. between peaks and troughs - but rather a continuous divergence measurement.
Essentially it is measuring at any given time, the correlation between the price and the MFI. This is smoothed with a moving average (configurable) to get cleaner lines.
CD is used to detect both a slowing down of momentum on the current trend, and a reversal of trend due to changing momentum.
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.