OPEN-SOURCE SCRIPT
Advanced CVD Div by E3K

E3K CVD Div — Cumulative Volume Delta Divergence Detector
This indicator calculates Cumulative Volume Delta (CVD) from intrabar data and detects divergences between price action and order flow across higher timeframe periods.
What it does
Price makes a new high, but buyers aren't actually in control — or price sweeps a low, but sellers aren't really there. This indicator catches those moments by comparing price extremes against CVD extremes across HTF periods, exposing the disagreement between what price shows and what volume confirms.
How it works
- CVD is built from lower-timeframe delta (buy vs. sell volume), giving you true intrabar precision — not just close > open approximations on your chart timeframe
- Each HTF period (auto-selected or manual) tracks CVD and price highs/lows independently
- When a new HTF period's price extreme exceeds the prior period but CVD fails to confirm, a divergence is flagged
- Supports both 2-period and 3-period divergence patterns for deeper structural reads
Two detection methods
- HTF Sweep — Only fires when price wicks beyond a prior HTF high/low (body stays inside). Fewer signals, higher conviction. Designed for sweep-and-reverse setups.
- All — Flags any directional disagreement between price and CVD across HTF periods. More signals, includes hidden divergences.
Key features
- High-precision CVD candles with proper wicks (built from LTF data — auto-selects appropriate resolution)
- Divergence strength scoring (0–1) with adjustable minimum threshold
- Separate bull/bear divergence colors with strength-based opacity
- Optional volume confirmation filter (requires above-average volume)
- Optional rejection candle filter (wick ≥ 60% of bar range)
- Delta spike detection — highlights statistical outlier bars (configurable σ threshold)
- Divergence expiry — auto-removes stale signals after N bars
- Configurable CVD anchor (continuous, daily, weekly, monthly)
- HTF alignment boxes to visualize period boundaries
- Rich alerts with strength, pattern type, method, ticker, and timeframe context
Recommended use
Works on any instrument with volume data. Best on liquid markets (futures, crypto, large-cap equities). Pair with price structure — divergences mark where smart money disagrees with price, but timing depends on your setup.
Credits
Original concept by cdikici71 & tncylyv — original script. Refactored and extended by Euro3000 — Pine v6, typed architecture, precision CVD engine, sweep-aligned divergences, and signal filtering.
This indicator calculates Cumulative Volume Delta (CVD) from intrabar data and detects divergences between price action and order flow across higher timeframe periods.
What it does
Price makes a new high, but buyers aren't actually in control — or price sweeps a low, but sellers aren't really there. This indicator catches those moments by comparing price extremes against CVD extremes across HTF periods, exposing the disagreement between what price shows and what volume confirms.
How it works
- CVD is built from lower-timeframe delta (buy vs. sell volume), giving you true intrabar precision — not just close > open approximations on your chart timeframe
- Each HTF period (auto-selected or manual) tracks CVD and price highs/lows independently
- When a new HTF period's price extreme exceeds the prior period but CVD fails to confirm, a divergence is flagged
- Supports both 2-period and 3-period divergence patterns for deeper structural reads
Two detection methods
- HTF Sweep — Only fires when price wicks beyond a prior HTF high/low (body stays inside). Fewer signals, higher conviction. Designed for sweep-and-reverse setups.
- All — Flags any directional disagreement between price and CVD across HTF periods. More signals, includes hidden divergences.
Key features
- High-precision CVD candles with proper wicks (built from LTF data — auto-selects appropriate resolution)
- Divergence strength scoring (0–1) with adjustable minimum threshold
- Separate bull/bear divergence colors with strength-based opacity
- Optional volume confirmation filter (requires above-average volume)
- Optional rejection candle filter (wick ≥ 60% of bar range)
- Delta spike detection — highlights statistical outlier bars (configurable σ threshold)
- Divergence expiry — auto-removes stale signals after N bars
- Configurable CVD anchor (continuous, daily, weekly, monthly)
- HTF alignment boxes to visualize period boundaries
- Rich alerts with strength, pattern type, method, ticker, and timeframe context
Recommended use
Works on any instrument with volume data. Best on liquid markets (futures, crypto, large-cap equities). Pair with price structure — divergences mark where smart money disagrees with price, but timing depends on your setup.
Credits
Original concept by cdikici71 & tncylyv — original script. Refactored and extended by Euro3000 — Pine v6, typed architecture, precision CVD engine, sweep-aligned divergences, and signal filtering.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
The Pleb, the Bera and the Ugly.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
The Pleb, the Bera and the Ugly.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.