Aktualisiert

CVD Divergence Insights

80 367
📘 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.

Versionshinweise
🔍 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.
Versionshinweise
## 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
Versionshinweise
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.
Versionshinweise
What's New

Absorption Cloud
A new visualization that renders the Insights oscillator directly on the price chart as a cloud overlay. The cloud represents the same divergence data as the oscillator pane, but mapped spatially to price.

  • Green cloud = aggressive bulls are being absorbed (same as green on the oscillator)
  • Red cloud = aggressive bears are being absorbed (same as red on the oscillator)


Settings: Scale factor, ATR length, and customizable colors.

Spike POC with Delta Profile
When a divergence spike (dot) is detected, the indicator can draw a horizontal line at the exact price level where volume concentrated within that bar — the POC. This identifies the precise level where failed pressure accumulated, often becoming support/resistance.

Delta Mode — The standout feature. Unlike TradingView's built-in Volume Profile which only shows total volume, this indicator can calculate and display Delta POC — the price level with the highest net buying or selling pressure within the spike bar. The Delta Profile shows exactly where inside the bar the battle was fought: green bins = net buying, red bins = net selling. This level of intrabar delta granularity is typically only available in professional order flow platforms.

Note: TradingView cannot provide real delta per price information so this feature should be impossible. We achieve this by looking a volume events on lower timeframes and approximating the position of the delta spike bar. Often this corresponds with volume POC but somethings they are quite different. Please refer to instruction videos on my YT channel for more information.

Features:
  • Profile Mode — Choose between Volume (total) or Delta (net buy/sell) visualization
  • Extend Lines — POC lines extend forward until price crosses through them (the zone has been "played")
  • Spike Profile — Optional per-bin profile overlay on spike candles
  • Merge Adjacent Spikes — Clusters of consecutive spike bars merge into a unified profile
  • Customizable — Line width, colors, price bins resolution


Consolidated Lookback Setting
The "Volume Normalization Length" setting has been renamed to "Lookback" and now controls both:
  • Volume normalization (what counts as "normal" volume for weighting)
  • Spike detection baseline (standard deviation calculation)


This provides more stable spike detection while reducing settings clutter. Default: 50 bars.

Improved Delta Accuracy
The indicator now uses TradingView's official ta library (v8) for volume delta calculations, matching the built-in Volume Delta indicator exactly. This fixes edge cases on thin/low-liquidity bars.

Note: Spike POC line colors must be configured in the Inputs tab — Pine Script does not support Style tab configuration for dynamically drawn lines.
Versionshinweise
# CVD Divergence Insights — Release Notes

**Bug Fixes**
- Fixed DPOC line color not matching the delta profile — now reflects actual delta direction at the POC bin
- Fixed last spike cluster on chart never being drawn (pending cluster now flushes on last bar)
- Fixed Passive Absorption background being permanently stuck once triggered — now properly turns off when divergence subsides
- Fixed POC extended lines silently expiring after 500 bars — now extend to chart end
- Fixed Big Trades volume filter sharing the Oscillator lookback — now uses its own independent lookback

**Improvements**
- Default Profile Mode changed from Volume to Delta
- Added sub-bar resolution quality display to info table (~300x Good / Fair / Poor / No resolution)
- Effort Score now correctly uses standard lower TF matching TradingView's built-in Volume Delta
- Spike detection always uses volume weighting (documented in tooltip) — the Volume Weighted toggle only affects the visual oscillator area
- Passive Absorption tooltip clarified — single orange color for any absorption regime, check Insights bulges for direction
- Profile and Big Trades tooltips now note that delta direction uses close-vs-open approximation

**Cleanup**
- Removed ~200 lines of dead code (two unused profile functions)
- Consolidated three identical MA functions into one
- Removed unused variable
Versionshinweise
New: Now using the new TradingView Footprint object for real server side, high precision, full history volume delta. This is only available on Premium accounts and up so we fallback gracefully to manual CVD/Delta calculations on lower account plans.

New: You can now activate a label that displays the delta value for the current bar. When delta values have many numbers we convert to 1k, 1m etc. You can also filter labels on low volume bars with a threshold and modify text size. This label is always drawn above bars.

Updated: The data detection labels is now consolidated and shows sub timeframe, quality of data and wether the footprint feature can be / is used by printing the letters fp with a checkmark.

Fixed: Passive Absorption detection feature restored.

Fixed: Various smaller optimizations, code refactorings and fixes.

Note: Some features, like "Big Trades" cannot use Footprint data and must rely on manual investigation of lower timeframe action. So Big Trades history will be limited depending on sub timeframe used. So when Big Trades suddenly stop rendering on historical data but the rest of the indicator does not, this is normal and a TradingView limitation. This limitation in the Footprint pinescript object also prevents us from getting data on stacked imbalances and other things. But we have something just as good, maybe even better which is Delta POC's (DPOC).

For more info on this Indicator, please refer to my YT channel.
Versionshinweise
Fix: Fixed problem with runtime error on some tickers where we used too many rows in the footprint object.

Updated: Big Trades labels with large numbers shortened with 1k, 1m etc.
Versionshinweise
Fix: Runtime error for non-premium plan users.
Versionshinweise
The footprint feature continues to cause problems. In this version I have fixed a compatibility issue where the indicator would crash on Essential, Plus, and Pro plans - footprint data is now opt-in (off by default) and can be enabled by Premium+ users in the Data Collection settings.
Versionshinweise
Restored the ability to change colors of the divergence plot.
Versionshinweise
Footprint is now off by default so that users with lower account types than premium doesn't get script errors. This means that if you have an account that supports this better data type, such as premium and ultimate will have to enable the "Use Footprint Data" to get the advantage of server side computed volume delta with higher accuracy.
Versionshinweise
Color options added for:
• Effort & Efficiency labels
• Bar Delta labels
• Passive Absorption background

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.