Price Divergence Detector V3 revised by JustUncleL

This is a revised version of the original "Price Divergence Detector by RicardoSantos".
Price Divergence detection for various methods : RSI , MACD , STOCH , VOLUME , ACC-DIST, FISHER, CCI , BB %B and Ehlers IdealRSI. Both Hidden and Regular Divergences are detected.

Revision 3.0 by JustUncleL
  • Added option to disable/enable Hidden and Regular Divergence
  • Added new divergence method BB %B (close only)
  • Added new divergence mothos Ehlers IdealRSI (close only)

Revision 2.0 - by RicardoSantos

Information on Divergence Trading:
  • http://www.babypips.com/school/high-school/trading-divergences
  • http://www.incrediblecharts.com/indicators/bollinger_percentage_b_band_width.php (BB %B)

Aug 02
Release Notes: Updated to Revision 3 of Pinescript
Updated with some RicardoSantos version 2.022 revisions.
Aug 03
Release Notes: ..
Added Elders Force Index method.
Other small changes.
Aug 19
Release Notes: 3.2 Update
  • Added Trend Volume Accumulation, this option really works only well with Renko and HA candles. You have the option to use EMA for trend direction change instead of candle bull/bear direction.
  • NOTE: Trader discretion is required to manually filter out invalid Divergence, there is no account made for the length of each trend when comparisons are made.
Remove from Favorite Scripts Add to Favorite Scripts


I'm a bit unclear on what the 'R' and the 'H' stand for. Could anybody explain what those imply? I'm trying to use this for RSI divergence.
+5 Reply
@iper404, They stand for Regular and Hidden divergence markers.
+1 Reply
I need script can alert every time signal R + H appear, Can you help me sort out it ?
+3 Reply
egsand diemtuvongoc
@diemtuvongoc, i can do that for this and other indicators
Very nice!

How can i make it show each divergences at the same time? currently you can only choose one indicator at a time
+2 Reply
Here is a link to the original R2 release by RicardoSantos:
+2 Reply
justinj54 JustUncleL
@JustUncleL, hello is there alerts added to this script for bullish and bearish divergence?
JustUncleL justinj54
@justinj54, None currently
MDicko123 JustUncleL
@JustUncleL, Is there any way to add any alerts. Is there a simple addition to add to the script maybe? Thanks

I like this script.
Thank you very much for making this script.

Sometimes i notice there is divergence which is not recognized by the script, for example :

Thank you.
+1 Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out