Inverse Divergence
Nov 17, 2021

The Inverse Divergence indicator is an experimental tool that reverses the traditional logic of divergence detection by using oscillator pivots as the primary reference point for comparison against price action. This approach aims to identify market discrepancies from the perspective of momentum and trend bias derived from the oscillator rather than price.
Usage
The indicator can be used to identify potential trend reversals or continuations by spotting discrepancies between oscillator movements and price action. Unlike standard divergence indicators that look for price pivots first, this tool identifies pivots on the selected oscillator and then checks if the price movement confirms or contradicts those pivots.
Key usage points include:
- Oscillator Selection: Users can choose from various oscillator sources like RSI, CCI, or MFI to drive the divergence logic.
- Trend Bias: The indicator calculates a trend bias based on the percentile rank of the oscillator. A rank above 60 suggests an upward bias, while a rank below 40 suggests a downward bias.
- Zigzag Visualization: The script plots a Zigzag based on the oscillator's high and low values to clearly mark the primary pivots being analyzed.
Details
In standard divergence analysis, price pivots are considered the primary source and are compared against oscillator values. The Inverse Divergence tool flips this methodology:
- Primary Source: Pivots are detected on the oscillator candles.
- Comparison: These oscillator pivots are then compared against the corresponding price levels.
- Bias Calculation: The trend bias is determined by the oscillator's position relative to its historical range using a
percentrankcalculation over a defined period.
The tool uses custom oscillator candles to normalize the selected momentum source, allowing for a more visual interpretation of momentum "price action."
Settings
Zigzag
- Zigzag Length: Determines the sensitivity of the pivot detection. Higher values result in fewer, more significant pivots.
- Zigzag Color: Customizes the visual appearance of the Zigzag lines.
Percentile
- Percent Candles: When enabled, uses percentile-based calculations for the oscillator candles.
- Percent Rank Length: The lookback period used to calculate the trend bias based on the oscillator's percentile rank.
Support/Resistance
- Oscillator Source: Allows selection of the base oscillator for the logic (options: CCI, CMO, COG, MFI, ROC, RSI, TSI).
FAQ
How do I use the Inverse Divergence indicator?
You can use it to find momentum-led reversals by observing how price reacts to the pivots formed on the oscillator Zigzag. Discrepancies between the oscillator trend and price trend may signal potential market shifts.
What is the "Inverse" part of the logic?
Traditional divergence looks at price peaks/troughs first. This indicator looks at oscillator peaks/troughs first and treats the oscillator as the "lead" indicator for pivot formation.
How can I get access to this tool?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.