Bull Bear Divergence Indicator
Dec 20, 2018

The Bull Bear Divergence Indicator tool identifies potential trend reversals by detecting discrepancies between price action and momentum oscillators using Constance Brown-inspired methodology.
Usage
The indicator can be used to spot early signs of momentum shifts that often precede price reversals. By default, it tracks the Relative Strength Index (RSI) to find divergences:
- Bullish Divergence: Occurs when the indicator makes a higher low while the price makes a lower low. This suggests that despite the price drop, downward momentum is weakening.
- Bearish Divergence: Occurs when the indicator makes a lower high while the price makes a higher high. This suggests that the upward trend is losing strength.
Users can identify these signals by looking at the highlighted pivot points on the oscillator. A thick green line indicates a bullish divergence, while a thick red line indicates a bearish divergence.
Details
This script implements a specific logic focused on "recent" pivots. Unlike some divergence indicators that look back across multiple swing points, this tool specifically compares the current pivot to the one immediately preceding it. This focus on immediate momentum shifts helps in identifying short-to-medium-term turning points.
While the default implementation uses a 14-period RSI, the logic is applicable to various oscillators. The construction relies on ta.pivothigh and ta.pivotlow functions to isolate key structural points in the momentum data. It is noted that while normalized oscillators like RSI work well, un-normalized indicators can often provide even clearer divergence signals.
Settings
- Indicator Source: The primary oscillator used for calculation (default is RSI 14).
- Pivot Lookback: Determines the sensitivity of pivot detection (handled via the script's calculation logic).
- Visuals: Users can toggle or adjust the visibility of the high/low indicator lines and the divergence highlights.
FAQ
How do I access the Bull Bear Divergence Indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Can I change the oscillator used for the divergence?
Yes, the script is designed to be adaptable. You can modify the source indicator in the Pine Script code to use other oscillators like MACD, Stochastic, or custom momentum lines.
What do the thick colored lines represent?
The thick green lines represent a confirmed Bullish Divergence at a recent pivot low, while the thick red lines represent a confirmed Bearish Divergence at a recent pivot high.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.