OPEN-SOURCE SCRIPT
CVD Complete Volume Analysis Pro

CVD Complete Volume Analysis Pro [v5] | Order Flow & Absorption
Introduction:
In the world of modern trading, Price is the advertisement, but Volume is the fuel. However, standard volume indicators on TradingView are often insufficient. They tell you how much was traded, but they don’t tell you how it was traded.
Was that large volume spike aggressive buying driving the trend? or was it a "buying frenzy" hitting a wall of passive limit orders (absorption)?
The CVD Complete Volume Analysis Pro (v5) is an advanced institutional-grade Order Flow engine. By utilizing 1-second intrabar data, this indicator reconstructs the "Tick Rule" to separate Aggressive (Market) orders from Passive (Limit) orders. It calculates Cumulative Volume Delta (CVD), detects Absorption/Distribution anomalies, and utilizes an embedded Logistic Regression model to predict daily directional bias.
This is not just an indicator; it is a complete Order Flow Dashboard designed to aid and support complex footprint charts for the everyday trader.
🏗️ How It Works: The "Micro-Structure" Engine
Most volume indicators on TradingView look at the close of a 1-minute or 5-minute bar to guess the volume direction. This script goes deeper.
1. The 1-Second Granularity
Using TradingView's request.security_lower_tf capability, this script pulls 1-second resolution data regardless of the chart timeframe you are on.
It analyzes the price movement every second.
It applies the "Tick Rule": If price moves up, volume is classified as Buy. If price moves down, volume is classified as Sell.
This allows for a highly accurate reconstruction of Buying vs. Selling pressure that standard indicators miss.
2. The "Cluster" Concept
The script aggregates these 1-second data points into Clusters.
Default: 60 seconds (1 minute) per cluster.
This creates a normalized "Heartbeat" of the market, allowing us to compare the efficiency of volume over fixed time windows, removing the noise of time-based chart distortions.
3. The "Passive" Detection Logic (The Core Feature)
This is the most powerful aspect of the tool. It calculates the relationship between Effort (CVD) and Result (Price Move).
The Baseline: The script calculates a rolling statistical baseline (Standard Deviation) of how much price should move for a given amount of Delta.
Absorption (Hidden Buying): If we see massive Aggressive Selling (Negative CVD) but price refuses to drop (or drops significantly less than the statistical model predicts), the script identifies this as Passive Buying.
Distribution (Hidden Selling): If we see massive Aggressive Buying (Positive CVD) but price refuses to rise, the script identifies this as Passive Selling.
📊 The Dashboard Breakdown
The on-screen dashboard is your command center. It updates in real-time to provide a snapshot of the market's internal mechanics.
Section 1: Flow Analysis
This section analyzes the current session's behavior.
Flow Type: Categorizes the market state using algorithmic logic.
Aggressive Buying/Selling: The market is trending, and aggressive participants are winning.
Strong Accumulation/Distribution: A reversal signal. Aggressive participants are trapped, and passive whales are absorbing order flow.
Flow vs. Price: Detects divergences instantly.
Bullish Divergence: Net Flow is Positive, but Price is down (indicates manipulation or temporary suppression).
Bearish Divergence: Net Flow is Negative, but Price is up (indicates a "trap" move).
Section 2: Volume Breakdown
A detailed ledger of the day's activity.
Aggressive Buy/Sell: Market orders executing at the ask/bid. This represents "Impatience."
Passive Buy/Sell: The estimated volume of Limit Orders absorbing the aggressive flow. This represents "Intent."
Net Flow: The mathematical sum of all buy pressure minus sell pressure.
Section 3: Net Positioning (Multi-Day)
Markets don't happen in a vacuum. This section looks back (default 5 days) to see the accumulated inventory.
Bias: Are we in a multi-day accumulation or distribution phase?
Activity Type:
High Hidden Activity: Indicates a fighting market with heavy limit orders (choppy/reversal prone).
Mostly Aggressive: Indicates a trending market with low resistance.
Section 4: Predictive Model (Machine Learning)
The script features an embedded Logistic Regression Model.
It trains on the last N days of Flow Data (CVD, Net Aggressive, Net Passive, Passive Ratios).
It outputs a Probability Score (0% to 100%) regarding the likelihood of an UP close for the current session.
Note: This is a probability model based on order flow history, not a guarantee. Use it as a bias confirmation tool.
🧠 Educational: How to Trade With This
Strategy 1: The "Absorption" Reversal
Context: Price hits a major resistance level.
Look at the Dashboard: You want to see "Flow Type" switch to "Strong Distribution".
The Logic: Price is rising, and aggressive buyers are hitting the ask. However, the script detects that for every buy order, a passive seller is absorbing it. Price stops moving up despite high volume.
The Trigger: When Price creates a lower low on the chart while the dashboard shows Distribution, this is a high-probability short entry.
Strategy 2: The Flow Divergence
Context: Price is trending down.
Look at the Dashboard: Price is making new lows, but the "Net Flow" is turning Green (Positive), or the "Cum CVD" is sloping upwards.
The Logic: This is "Effort vs. Result." Sellers are exhausted. They are pushing price down, but the net flow is shifting to buyers.
The Trigger: Enter Long on the first structure break.
Strategy 3: Trend Continuation
Context: Market is opening or breaking a range.
Look at the Dashboard: You want "Full Alignment."
Signals: "Flow Type" says Aggressive Buying, Net Flow is Positive, and the Predictive Model shows >60% Bullish Probability.
The Logic: There is no passive resistance. Aggressive buyers are pushing price up freely.
The Trigger: Buy pullbacks.
⚙️ Settings & Configuration
Cluster Size: The number of 1-second bars to group together.
Use 60 (1 min) for Scalping.
Use 300 (5 min) for Day Trading.
Average Length: The baseline for statistical calculations. Higher numbers = smoother baselines but slower adaptation.
Detection Settings:
Passive Multiplier: Adjusts the sensitivity of the absorption estimation. 1.0 is standard. Increase to 1.5 if you only want to see extreme anomalies.
Daily Tracking:
History Days: How many days of data to display in the table. Note: Due to TradingView data limits, keeping this between 3-5 days ensures the most stability.
⚠️ Important Technical Limitations
Please read this section carefully to understand the constraints of the Pine Script environment:
Data Depth (The 100k Limit): TradingView limits request.security_lower_tf to approximately 100,000 intrabars.
This means the script can typically only "see" the last 3 to 5 days of true 1-second data.
If you set History Days or Training Days too high (e.g., 20 days), the script may return 0 values for older dates because the high-resolution data simply doesn't exist on the server.
Approximation of Ticks: While 1-second data is extremely precise, it is still an aggregation. In extremely high-volatility events (like CPI releases), multiple ticks happen inside one second. The script attributes the volume of that second based on the close relative to the open/prev close. It is the best approximation possible on TradingView, but not a replacement for Level 3 Tick Data feeds.
Calculation Time: This is a heavy script. On lower-end devices or when loading on many charts simultaneously, you may experience a "Calculation took too long" warning. If this happens, reduce the History Days to 3.
🛡️ Disclaimer
No Repainting: This indicator uses strict historical referencing and does not repaint closed clusters.
Not Financial Advice: This tool provides data visualization. Order flow is a subjective art. Always manage your risk.
Author's Note:
I built this tool because I wanted the power of Order Flow footprint charts without the visual clutter. By using statistical baselines to detect passive liquidity, we can finally see the "invisible hand" of the market directly on our TradingView charts. I hope this adds value to your trading.
👍 If you find this script useful, please leave a Boost and a Comment below!
Introduction:
In the world of modern trading, Price is the advertisement, but Volume is the fuel. However, standard volume indicators on TradingView are often insufficient. They tell you how much was traded, but they don’t tell you how it was traded.
Was that large volume spike aggressive buying driving the trend? or was it a "buying frenzy" hitting a wall of passive limit orders (absorption)?
The CVD Complete Volume Analysis Pro (v5) is an advanced institutional-grade Order Flow engine. By utilizing 1-second intrabar data, this indicator reconstructs the "Tick Rule" to separate Aggressive (Market) orders from Passive (Limit) orders. It calculates Cumulative Volume Delta (CVD), detects Absorption/Distribution anomalies, and utilizes an embedded Logistic Regression model to predict daily directional bias.
This is not just an indicator; it is a complete Order Flow Dashboard designed to aid and support complex footprint charts for the everyday trader.
🏗️ How It Works: The "Micro-Structure" Engine
Most volume indicators on TradingView look at the close of a 1-minute or 5-minute bar to guess the volume direction. This script goes deeper.
1. The 1-Second Granularity
Using TradingView's request.security_lower_tf capability, this script pulls 1-second resolution data regardless of the chart timeframe you are on.
It analyzes the price movement every second.
It applies the "Tick Rule": If price moves up, volume is classified as Buy. If price moves down, volume is classified as Sell.
This allows for a highly accurate reconstruction of Buying vs. Selling pressure that standard indicators miss.
2. The "Cluster" Concept
The script aggregates these 1-second data points into Clusters.
Default: 60 seconds (1 minute) per cluster.
This creates a normalized "Heartbeat" of the market, allowing us to compare the efficiency of volume over fixed time windows, removing the noise of time-based chart distortions.
3. The "Passive" Detection Logic (The Core Feature)
This is the most powerful aspect of the tool. It calculates the relationship between Effort (CVD) and Result (Price Move).
The Baseline: The script calculates a rolling statistical baseline (Standard Deviation) of how much price should move for a given amount of Delta.
Absorption (Hidden Buying): If we see massive Aggressive Selling (Negative CVD) but price refuses to drop (or drops significantly less than the statistical model predicts), the script identifies this as Passive Buying.
Distribution (Hidden Selling): If we see massive Aggressive Buying (Positive CVD) but price refuses to rise, the script identifies this as Passive Selling.
📊 The Dashboard Breakdown
The on-screen dashboard is your command center. It updates in real-time to provide a snapshot of the market's internal mechanics.
Section 1: Flow Analysis
This section analyzes the current session's behavior.
Flow Type: Categorizes the market state using algorithmic logic.
Aggressive Buying/Selling: The market is trending, and aggressive participants are winning.
Strong Accumulation/Distribution: A reversal signal. Aggressive participants are trapped, and passive whales are absorbing order flow.
Flow vs. Price: Detects divergences instantly.
Bullish Divergence: Net Flow is Positive, but Price is down (indicates manipulation or temporary suppression).
Bearish Divergence: Net Flow is Negative, but Price is up (indicates a "trap" move).
Section 2: Volume Breakdown
A detailed ledger of the day's activity.
Aggressive Buy/Sell: Market orders executing at the ask/bid. This represents "Impatience."
Passive Buy/Sell: The estimated volume of Limit Orders absorbing the aggressive flow. This represents "Intent."
Net Flow: The mathematical sum of all buy pressure minus sell pressure.
Section 3: Net Positioning (Multi-Day)
Markets don't happen in a vacuum. This section looks back (default 5 days) to see the accumulated inventory.
Bias: Are we in a multi-day accumulation or distribution phase?
Activity Type:
High Hidden Activity: Indicates a fighting market with heavy limit orders (choppy/reversal prone).
Mostly Aggressive: Indicates a trending market with low resistance.
Section 4: Predictive Model (Machine Learning)
The script features an embedded Logistic Regression Model.
It trains on the last N days of Flow Data (CVD, Net Aggressive, Net Passive, Passive Ratios).
It outputs a Probability Score (0% to 100%) regarding the likelihood of an UP close for the current session.
Note: This is a probability model based on order flow history, not a guarantee. Use it as a bias confirmation tool.
🧠 Educational: How to Trade With This
Strategy 1: The "Absorption" Reversal
Context: Price hits a major resistance level.
Look at the Dashboard: You want to see "Flow Type" switch to "Strong Distribution".
The Logic: Price is rising, and aggressive buyers are hitting the ask. However, the script detects that for every buy order, a passive seller is absorbing it. Price stops moving up despite high volume.
The Trigger: When Price creates a lower low on the chart while the dashboard shows Distribution, this is a high-probability short entry.
Strategy 2: The Flow Divergence
Context: Price is trending down.
Look at the Dashboard: Price is making new lows, but the "Net Flow" is turning Green (Positive), or the "Cum CVD" is sloping upwards.
The Logic: This is "Effort vs. Result." Sellers are exhausted. They are pushing price down, but the net flow is shifting to buyers.
The Trigger: Enter Long on the first structure break.
Strategy 3: Trend Continuation
Context: Market is opening or breaking a range.
Look at the Dashboard: You want "Full Alignment."
Signals: "Flow Type" says Aggressive Buying, Net Flow is Positive, and the Predictive Model shows >60% Bullish Probability.
The Logic: There is no passive resistance. Aggressive buyers are pushing price up freely.
The Trigger: Buy pullbacks.
⚙️ Settings & Configuration
Cluster Size: The number of 1-second bars to group together.
Use 60 (1 min) for Scalping.
Use 300 (5 min) for Day Trading.
Average Length: The baseline for statistical calculations. Higher numbers = smoother baselines but slower adaptation.
Detection Settings:
Passive Multiplier: Adjusts the sensitivity of the absorption estimation. 1.0 is standard. Increase to 1.5 if you only want to see extreme anomalies.
Daily Tracking:
History Days: How many days of data to display in the table. Note: Due to TradingView data limits, keeping this between 3-5 days ensures the most stability.
⚠️ Important Technical Limitations
Please read this section carefully to understand the constraints of the Pine Script environment:
Data Depth (The 100k Limit): TradingView limits request.security_lower_tf to approximately 100,000 intrabars.
This means the script can typically only "see" the last 3 to 5 days of true 1-second data.
If you set History Days or Training Days too high (e.g., 20 days), the script may return 0 values for older dates because the high-resolution data simply doesn't exist on the server.
Approximation of Ticks: While 1-second data is extremely precise, it is still an aggregation. In extremely high-volatility events (like CPI releases), multiple ticks happen inside one second. The script attributes the volume of that second based on the close relative to the open/prev close. It is the best approximation possible on TradingView, but not a replacement for Level 3 Tick Data feeds.
Calculation Time: This is a heavy script. On lower-end devices or when loading on many charts simultaneously, you may experience a "Calculation took too long" warning. If this happens, reduce the History Days to 3.
🛡️ Disclaimer
No Repainting: This indicator uses strict historical referencing and does not repaint closed clusters.
Not Financial Advice: This tool provides data visualization. Order flow is a subjective art. Always manage your risk.
Author's Note:
I built this tool because I wanted the power of Order Flow footprint charts without the visual clutter. By using statistical baselines to detect passive liquidity, we can finally see the "invisible hand" of the market directly on our TradingView charts. I hope this adds value to your trading.
👍 If you find this script useful, please leave a Boost and a Comment below!
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.