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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
The Pleb, the Bera and the Ugly.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
The Pleb, the Bera and the Ugly.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.