Divergences v2.0
Feb 13, 2019

The Divergences v2.0 indicator is a comprehensive tool designed to detect both regular and hidden divergences across a wide array of popular technical oscillators. By analyzing price action in relation to indicator momentum, it helps traders identify potential reversals and trend continuations directly on the price chart.
Usage
The indicator scans for discrepancies between price movement and selected technical indicators. When a divergence is found, the script plots a line on the chart to visualize the connection between the relevant peaks or valleys.
- Positive (Bullish) Divergence: Marked with green lines or labels, appearing when the price makes a lower low but the indicator makes a higher low.
- Negative (Bearish) Divergence: Marked with red lines or labels, appearing when the price makes a higher high but the indicator makes a lower high.
- Hidden Divergences: When enabled, these appear as thinner blue lines, representing potential trend continuation patterns.
Traders can toggle specific indicators on or off in the settings to filter for divergences only on their preferred oscillators.
Details
The script utilizes a Multi-Timeframe (MTF) ZigZag logic to identify significant tops and bottoms. It automatically determines a "Higher Time Frame" (HTF) based on your current chart interval to ensure the pivot points used for divergence detection are structurally significant.
The HTF mapping follows this logic:
- 1–5m charts use a 5–15m HTF.
- 15–45m charts use a 1h HTF.
- 1–4h charts use a 4h–1d HTF.
- Daily and Weekly charts use a Weekly HTF.
By calculating divergences based on these filtered pivot points, the indicator aims to reduce noise and highlight more reliable setups.
Settings
- Indicator Selection: Checkboxes to enable or disable divergence detection for RSI, MACD, MACD Histogram, Stochastic, CCI, Momentum, OBV, Diosc, VWMACD, and Chaikin Money Flow (CMF).
- Show Hidden Divergences: Toggle to display hidden bullish and bearish divergence patterns.
FAQ
How do I use the Divergences v2.0 indicator?
You can use the signals to identify potential exhaustion in a trend (regular divergence) or potential entries for trend continuation (hidden divergence) across multiple oscillators simultaneously.
Can I set alerts for these divergences?
Yes, the script includes built-in alert functionality for positive, negative, and hidden divergences that trigger upon bar close.
How can I access this script?
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.