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.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
The Pleb, the Bera and the Ugly.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
The Pleb, the Bera and the Ugly.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.