OPEN-SOURCE SCRIPT
Aggiornato

CVD Divergence Insights

31 590
📘 CVD Divergence Insights – by Colicoid

Pine Script v6 | Volume Delta Divergence Oscillator with Spike Detection



🔍 Overview

CVD Divergence Insights is a volume-aware oscillator and divergence spike detector that helps you spot smart money activity, absorption, failed pressure, and hidden strength or weakness — even when price action alone gives little away.

It works by comparing normalized Cumulative Volume Delta (CVD) against normalized price movement, and optionally applying a volume-weighting layer to highlight when aggressive participation is truly behind the divergence. The result is a dynamic visual tool that identifies tension in the market, and helps you trade based on how that tension resolves.



🧠 Core Concept
• When price moves one way and CVD moves another, it reflects imbalance between aggression and result.
• Divergence is not a trigger — it’s a build-up of pressure.
• The real edge lies in the resolution of that pressure.
• Optional volume-weighting helps you ignore noise and focus on high-conviction moves only.



⚙️ How It Works
1. CVD Calculation
CVD is generated using lower-timeframe delta volume (buy vs. sell pressure), accumulated per bar.
2. Oscillator
A normalized divergence between the smoothed CVD and smoothed price.
3. Volume Weighting (optional)
Emphasizes divergences occurring on higher-than-normal volume, deprioritizes low-volume noise.
4. Signal Line (optional)
A short EMA of the oscillator to help track momentum shifts (hidden by default).
5. Divergence Spikes
Statistical spike detection using standard deviation — green/red dots highlight unusually large divergence activity.



🎛️ Inputs

Anchor Period
Higher timeframe where the CVD is accumulated and processed.

Lower Timeframe
Optional override for granularity of buy/sell volume data.

SMA Length
Used for smoothing both price and CVD before divergence is calculated.

Volume Weighted?
Enables adaptive weighting based on relative volume size.

Volume Normalization Length
Lookback period used to define what is “normal” volume.

Divergence Spike Threshold
StdDev-based threshold to detect abnormally large divergences.

Signal Line Length
Controls the EMA smoothing of the optional signal line (hidden by default).



📈 Trade Setup Example: Hidden Bullish Divergence
1. Price forms a higher low, but CVD forms a lower low — hidden bullish divergence.
2. This shows aggressive sellers are trying, but price is resilient — likely absorption.
3. You wait for a "convergent signal bar":
• A bullish candle with strong structure or body
• Confirmed by CVD starting to turn upward
4. That’s your trigger bar — the tension resolves upward.



🤝 Recommended Pairings

For best results, combine CVD Divergence Insights with the companion script:

🔗 Cumulative Volume Delta Line (also by Colicoid)

This lets you:
• See the raw CVD line and its SMA visually
• Spot standard and hidden divergences in price/CVD directly
• Use the Insights indicator to evaluate divergence quality and flag aggressive bull/bear behavior
• Use the same SMA length on both indicators for alignment

👉 Tip: To save screen space, drag the CVD Line indicator into the same panel as CVD Divergence Insights.



🧰 Why Use This?
• ✅ Catch absorption setups and failed pressure zones
• ✅ Filter out low-quality divergences using volume context
• ✅ Understand why price is hesitating or breaking out
• ✅ Add smart confirmation to breakout/reversal trades
• ✅ Align your execution with who’s actually in control



📎 Created by Colicoid

Built in Pine Script v6 for advanced price-volume analysis, with focus on effort vs result, market psychology, and smart money detection.

Note di rilascio
🔍 Overview
CVD Divergence Insights is a volume-aware oscillator and divergence spike detector that helps you spot smart money activity, absorption, failed pressure, and hidden strength or weakness -even when price action alone gives little away.

Big green/red bulges and spikes (dots) indicate "pressure" without results. Aggressive market participants are pushing hard without moving price - they are being absorbed.
Mnemonic: Spikes = Struggle

When it's flat or near the zero line, pressure and result are in alignment. Price is moving in harmony with the underlying pressure and no significant tug-of-war is occurring.
Mnemonic: Flat = Flow

How it works
It works by comparing normalized Cumulative Volume Delta (CVD) against normalized price movement, and optionally applying a volume-weighting layer to highlight when aggressive participation is truly behind the divergence. The result is a dynamic visual tool that identifies tension in the market, and helps you trade based on how that tension resolves.



🧠 Core Concept
• When price moves one way and CVD moves another, it reflects imbalance between aggression and result.
• Divergence is not a trigger — it’s a build-up of pressure.
• The real edge lies in the resolution of that pressure.
• Optional volume-weighting helps you ignore noise and focus on high-conviction moves only.
• When the background is colored, the indicator has detected "chronic divergence" which could mean that the market is controlled mainly by limit-order participants - most likely the Composite Operator / Smart Money. Trust price more.


⚙️ How It Works
1. CVD Calculation
CVD is generated using lower-timeframe delta volume (buy vs. sell pressure), accumulated per bar.
2. Oscillator
A normalized divergence between the smoothed CVD and smoothed price.
3. Volume Weighting (optional)
Emphasizes divergences occurring on higher-than-normal volume, deprioritizes low-volume noise.
4. Signal Line (optional)
A short EMA of the oscillator to help track momentum shifts (hidden by default).
5. Divergence Spikes
Statistical spike detection using standard deviation — green/red dots highlight unusually large divergence activity.



🎛️ Inputs

Anchor Period
Higher timeframe where the CVD is accumulated and processed.

Lower Timeframe
Optional override for granularity of buy/sell volume data.

SMA Length
Used for smoothing both price and CVD before divergence is calculated.

Volume Weighted?
Enables adaptive weighting based on relative volume size.

Volume Normalization Length
Lookback period used to define what is “normal” volume.

Divergence Spike Threshold
StdDev-based threshold to detect abnormally large divergences.

Signal Line Length
Controls the EMA smoothing of the optional signal line (hidden by default).

Passive Absorption
A case of chronic divergence is detected a.k.a "inversion chart". Divergences does not lead to results. This could mean that the market is under the control of strong limit-order participants (trap regime) - the Composite Operator. Trust price more.



📈 Trade Setup Example: Hidden Bullish Divergence
1. Price forms a higher low, but CVD forms a lower low — hidden bullish divergence.
2. This shows aggressive sellers are trying, but price is resilient — likely absorption.
3. You wait for a "convergent signal bar":
• A bullish candle with strong structure or body
• Confirmed by CVD starting to turn upward
4. That’s your trigger bar — the tension resolves upward.



🤝 Recommended Pairings

For best results, combine CVD Divergence Insights with the companion script:

🔗 Cumulative Volume Delta Line (also by Colicoid)

This lets you:
• See the raw CVD line (the pressure itself) and its SMA visually
• Spot standard and hidden divergences in price/CVD directly
• Use the Insights indicator to evaluate divergence quality and flag aggressive bull/bear behavior
• Use the same SMA length on both indicators for alignment

👉 Tip: To save screen space, drag the CVD Line indicator into the same panel as CVD Divergence Insights.



🧰 Why Use This?
• ✅ Catch absorption setups and failed pressure zones
• ✅ Filter out low-quality divergences using volume context
• ✅ Understand why price is hesitating or breaking out
• ✅ Add smart confirmation to breakout/reversal trades
• ✅ Align your execution with who’s actually in control



📎 Created by Colicoid

Built in Pine Script v6 for advanced price-volume analysis, with focus on effort vs result, market psychology, and smart money detection.
Note di rilascio
## Update: Settings Aligned with CVD Line + New MA Types + Data Improvements + New Effort & Efficiency tool

This update brings CVD Divergence Insights in line with the companion CVD Line indicator so both tools share the same settings structure and work seamlessly together. It also introduces a new per-bar Effort & Efficiency analysis layer.

### What's New

**Effort & Efficiency Labels (optional)**
A new overlay feature that displays two numbers per bar directly on the price chart, below the candles.

- **Effort Score (0–100)**: How much aggressive energy was deployed on this bar. Based on volume-weighted delta ranked against the last 500 bars.
- **Efficiency Ratio (%)**: How effectively that effort translated into price movement in the intended direction. Negative values mean effort backfired — the aggressors were absorbed. Above 100% means ease of movement with little resistance.
- **Color**: The label is colored based on positive/negative delta. Green = bulls were the most aggressive, Red = bears were the main aggressors.

This can be used as a diagnostic tool to evaluate strength of breakouts, swings, declines and all kinds of situations.

You can use this to spot regular, per candle, delta divergences. So if a candle is closing bullish but the label is red, that is a delta divergence.

Disabled by default. Enable via Settings → Effort & Efficiency → Show Effort & Efficiency.

**12 Moving Average Types**
You can now choose from 12 different MA algorithms used internally to calculate the Insights area: SMA, EMA, WMA, RMA, HMA, DEMA, TEMA, ZLEMA, LSMA, SMMA, ALMA, and SWMA. This applies to both the price and CVD smoothing used in the oscillator calculation. Default changed from SMA to EMA 14 for better responsiveness.

**1-Second and Tick Data Support**
New "Lower TF for 5m and below" setting automatically uses 1-second data (Premium+) or tick data (Expert+) on short timeframe charts for more precise delta calculation. Falls back gracefully to 1-minute data if your TradingView plan doesn't support it.

**Data Status Table**
An info table in the bottom-right corner shows which lower timeframe resolution is active. Displays a clear warning with upgrade guidance if the requested data resolution is unavailable — no more manually fiddling with data when going up/down timeframes.

**Unified Settings with CVD Line**
The settings panel now mirrors the CVD Line indicator exactly: same group names, same input labels, same data collection logic. If you use both indicators together (recommended), you only need to learn one settings layout. Please note that they should be set to the same data and MA settings to compliment each other.

### Settings Overview

- **Data Collection**: Anchor period, Use custom timeframe, Lower TF for 5m and below (Off / 1s / Tick)
- **Moving Average**: MA Length (14), MA Type (EMA)
- **Oscillator**: Volume Weighted, Volume Normalization Length, Spike Threshold, Signal Line Length
- **Effort & Efficiency**: Show labels, Lookback (500), Min Score to Display (50), Label Size
- **Display**: Passive Absorption background

### Technical Notes

- Upgraded to Pine Script v6
- Anchor period defaults to Chart (empty) for smooth per-bar delta without session jumps (this essentially switches the indicator to use Volume Delta rather than CVD, but it makes it more responsive.
- Division-by-zero guards on normalization prevent NaN in low-activity periods
- Volume data error detection with clear runtime message
- Effort labels use force_overlay to render on the price chart from an indicator pane
- Efficiency uses close-to-close measurement (not open-to-close) to capture gaps
Note di rilascio
Two bugfixes in this version.
1. The effort/efficiency label sometimes went all green during extended low volume periods. I switched to TradingView's internal library for delta calculation to fix this.
2. In the new version I had accidentally broken the Anchor Period and only the "Chart" setting was working. This is now fixed too.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.