PROTECTED SOURCE SCRIPT
Zaktualizowano

CVD Absorption & Distribution Pro v3 (With Logit Regression)

775
CVD Absorption & Distribution Pro v3 - Complete Guide
Introduction and Overview
The CVD Absorption and Distribution Pro v3 is an advanced trading indicator designed for TradingView that reveals hidden market dynamics invisible on standard price charts. This tool analyzes the battle between buyers and sellers at the micro level, identifying when large institutional players are quietly accumulating or distributing positions while price remains deceptively stable.

Traditional volume indicators fail traders because they treat all volume the same way. They cannot distinguish between aggressive buying and aggressive selling. More importantly, they cannot reveal when significant selling pressure is being absorbed by hidden buyers, or when strong buying pressure is being quietly distributed by large sellers. This information asymmetry has historically given institutional traders a massive advantage over retail participants.

This indicator solves that problem by implementing Cumulative Volume Delta analysis combined with machine learning prediction models, hidden liquidity detection, and comprehensive statistical validation. The result is a professional-grade analytical tool that was previously available only on expensive specialized platforms, now accessible to the entire TradingView community.

What is Cumulative Volume Delta
Cumulative Volume Delta, commonly known as CVD, is a method of categorizing trading volume based on whether it represents buying or selling pressure. The concept is straightforward. When price ticks upward from one moment to the next, the volume associated with that price movement is classified as buying volume. When price ticks downward, that volume is classified as selling volume. The difference between total buying volume and total selling volume over a given period is the delta.

A positive delta indicates that buyers were more aggressive during that period. A negative delta indicates sellers were more aggressive. By tracking this delta cumulatively over time, traders can see the underlying pressure that may not be immediately visible in price action alone.

However, raw CVD analysis has limitations. The real trading edge emerges when we compare what the CVD suggested should happen to price versus what actually happened. When there is significant selling pressure but price fails to decline, something interesting is occurring. Someone is absorbing all that selling. This is where the concepts of absorption and distribution become critically important.

Core Functionality Explained
The indicator operates by accessing one-second bar data from TradingView, the finest granularity available on the platform. This micro-level data is then grouped into clusters, which are user-configurable time blocks. The default setting creates clusters of sixty one-second bars, effectively creating one-minute analysis blocks. However, traders can adjust this to create clusters representing anywhere from a few seconds to several minutes depending on their trading style.

For each one-second bar within a cluster, the script must determine whether to classify the volume as buying or selling. This classification happens based on whether price moved up or down compared to the previous bar. But what happens when price does not change at all? The indicator provides three methods to handle this situation.

The first method, called Last Direction, assigns unchanged volume to whichever direction occurred most recently. If the previous tick was an uptick, the unchanged volume is counted as buying. This approach assumes market momentum tends to persist at very short timeframes.

The second method, called Split Fifty-Fifty, divides unchanged volume equally between buying and selling. This conservative approach acknowledges that when price does not move, we genuinely cannot know whether buyers or sellers were responsible.

The third method simply ignores unchanged ticks entirely, excluding them from the CVD calculation. This purist approach ensures only directionally confirmed volume influences the analysis.

Understanding Absorption
Absorption is one of the two primary signals this indicator detects. Absorption occurs when significant selling pressure fails to push price lower. Imagine a scenario where the delta is strongly negative, meaning sellers are aggressively hitting bids and overwhelming buyers. Under normal circumstances, this should drive price down. But if price stays flat or even rises despite this selling pressure, something unusual is happening. A large buyer is absorbing all that selling without allowing price to fall.

This behavior is characteristic of institutional accumulation. Large players who want to build substantial positions cannot simply place massive buy orders because that would move price against them immediately. Instead, they often buy by absorbing selling pressure. They let other participants sell to them at stable prices, quietly accumulating shares without revealing their intentions.

The indicator identifies absorption by first checking whether the CVD magnitude exceeds a calculated threshold based on historical averages. If the CVD is significantly negative and exceeds this threshold, the script then examines what happened to price. If price moved up or stayed flat, this is classified as full absorption. If price moved down but moved less than expected given the selling pressure, this is classified as partial absorption.

The expected price move is calculated based on the relationship between CVD magnitude and typical price movement observed historically. If current CVD is twice the average, the expected price move would be approximately twice the average price move. When actual price movement falls short of this expectation, the shortfall percentage quantifies the absorption.

Understanding Distribution
Distribution is the mirror image of absorption. It occurs when significant buying pressure fails to push price higher. When delta is strongly positive but price stays flat or even declines, someone is distributing shares into that buying pressure. They are selling to eager buyers without allowing price to rise.

This behavior characterizes institutional distribution. Large holders who want to exit substantial positions face the same challenge as accumulators. They cannot simply dump massive sell orders because that would crash the price before they finish selling. Instead, they often sell by distributing into buying pressure, letting other participants buy from them at stable prices while quietly reducing their position.

The indicator identifies distribution using the same logic as absorption but in reverse. Strongly positive CVD that exceeds the threshold combined with flat or declining price signals distribution. Partial distribution is identified when price rises but rises less than the CVD magnitude would suggest.

Hidden Liquidity Detection
Perhaps the most valuable feature of this indicator is its ability to quantify hidden liquidity. Hidden liquidity refers to large orders that are not fully visible in the order book. Institutional traders commonly use iceberg orders, which display only a small portion of the total order size while the rest remains hidden. As the visible portion gets filled, more of the hidden quantity is revealed.

The indicator estimates hidden liquidity by analyzing partial absorption and partial distribution events. When price moves less than expected given the CVD, the difference represents volume that was absorbed by hidden orders. The cumulative hidden buy liquidity and hidden sell liquidity provide insight into institutional activity that remains completely invisible on standard charts.

A high ratio of hidden buy liquidity to hidden sell liquidity suggests institutional accumulation is occurring. Conversely, a high ratio of hidden sell liquidity to hidden buy liquidity suggests institutional distribution. These signals often precede significant price movements as the institutional positioning eventually influences market direction.

The Prediction Model
This indicator goes beyond simple pattern detection by implementing a genuine machine learning model trained on historical data. The model uses logistic regression to predict whether price will move up or down in subsequent clusters based on current market conditions.

The model considers three primary factors. First, it looks at the normalized CVD, which measures current CVD relative to its historical average and variability. Second, it examines net flow, which is the difference between absorption and distribution. Third, it analyzes hidden flow, the difference between hidden buy liquidity and hidden sell liquidity.

During the training process, the model examines historical clusters where price actually moved significantly. It learns the relationship between these three factors and subsequent price direction. Through iterative gradient descent, the model adjusts its coefficients to best fit the historical data.

The output is a probability between zero and one representing the likelihood that the next cluster will see upward price movement. A probability above sixty percent suggests bullish conditions. A probability below forty percent suggests bearish conditions. Values between forty-five and fifty-five percent indicate neutral or uncertain conditions.

Model Validation Metrics
The indicator provides several metrics to help traders assess whether the prediction model is actually useful for the specific instrument they are analyzing. This validation is critically important because not all instruments exhibit predictable CVD-price relationships.

Logistic Accuracy shows the percentage of correct binary predictions across the training window. An accuracy of fifty percent is essentially random, providing no edge. Accuracy above fifty-five percent suggests the model has genuine predictive value.

Sign Agreement Rate measures how often CVD direction matched price direction historically. When CVD is positive and price goes up, or when CVD is negative and price goes down, this counts as agreement. A sign agreement rate significantly above fifty percent indicates that CVD provides useful directional information for this instrument.

Weighted Sign Agreement applies the same concept but weights each observation by CVD magnitude. High-magnitude CVD events that correctly predict direction count more than low-magnitude events. This metric reveals whether strong CVD signals are more reliable than weak ones.

If these validation metrics are close to fifty percent, traders should be cautious about relying on the model for that particular instrument. The CVD-price relationship may be too noisy or the market microstructure may not suit this type of analysis.

Bucket Analysis
The indicator performs bucket analysis by segmenting historical data into five groups based on CVD magnitude. The first bucket contains clusters where CVD was very strongly negative, more than twice the average in the negative direction. The second bucket contains moderately negative CVD clusters. The third bucket represents neutral conditions where CVD was within one standard average of zero in either direction. The fourth bucket contains moderately positive CVD, and the fifth bucket contains very strongly positive CVD.

For each bucket, the indicator calculates what percentage of clusters saw price move upward. In a market where CVD has predictive value, we would expect to see low upward percentages in negative CVD buckets and high upward percentages in positive CVD buckets. The spread between the highest and lowest buckets indicates how useful CVD is for predicting direction.

If the bucket analysis shows similar upward percentages across all buckets, the CVD-price relationship is essentially random for that instrument. If the pattern shows the expected gradient from low to high, CVD analysis should provide genuine trading edge.

Strength Tiers
Not all absorption and distribution events are equally significant. The indicator classifies events into three strength tiers based on their magnitude relative to baseline averages.

Normal events occur when CVD is between one and two times the average magnitude. These events happen regularly throughout trading sessions and represent standard market dynamics.

Strong events occur when CVD is between two and three times the average magnitude. These elevated significance events warrant additional attention and may indicate more substantial institutional activity.

Exceptional events occur when CVD exceeds three times the average magnitude. These rare occurrences often precede significant price movements and represent major institutional footprints in the market.

The indicator tracks how many events of each tier occurred during the display period, helping traders identify sessions with unusual institutional activity.

Divergence Detection
The indicator implements sophisticated divergence detection that compares trends in CVD with trends in price over a rolling window of recent clusters. Divergence occurs when these two metrics move in opposite directions or when one moves significantly while the other remains flat.

Bullish divergence manifests in two forms. Hidden accumulation occurs when the CVD trend turns increasingly positive while price remains flat, suggesting buying pressure is building without yet moving price. CVD accumulation occurs when average CVD is positive but average price movement is minimal.

Bearish divergence also manifests in two forms. Hidden distribution occurs when CVD trend turns increasingly negative while price remains stable, suggesting selling pressure is building. CVD distribution occurs when average CVD is negative but price refuses to decline.

Divergence signals are quantified by their strength relative to baseline averages, allowing traders to prioritize the most significant divergences.

Display and Interface
The indicator presents all its analysis through a comprehensive table overlay positioned on the chart. The table is organized into logical sections that can be individually enabled or disabled based on trader preferences.

The Direction Prediction section shows the current signal, probability, and period cluster breakdown between bullish, bearish, and neutral predictions. The Model Performance section displays accuracy metrics and training sample counts.

The CVD Bucket Analysis section shows the five-bucket breakdown with upward percentages for each, along with an interpretation of whether a predictable pattern exists.

The Baselines section displays the calculated averages for CVD and price movement, along with the current threshold being used for event detection.

The Results section shows total absorption and distribution for the display period, the ratio between them, net values, and an overall flow signal interpretation.

The Full versus Partial section breaks down events by type, showing how much activity was full absorption or distribution versus partial events indicating hidden liquidity.

The Hidden Liquidity section displays estimated hidden buy and sell volumes, their ratio, average shortfall percentages, and an iceberg signal interpretation.

The Strength Tiers section shows event counts by tier for both absorption and distribution, highlighting any exceptional events.

The Divergence section indicates whether bullish or bearish divergence is currently present and its strength.

The Statistics section provides cluster counts and event counts for reference.

Configuration Recommendations
For scalping and very short-term trading with holding periods of one to five minutes, traders should use smaller cluster sizes around thirty to sixty seconds, shorter average lengths around two to three hundred clusters, and enable intensity weighting to emphasize high-magnitude events.

For day trading with holding periods of fifteen to sixty minutes, the default settings work well. Cluster size of sixty for one-minute analysis, average length of seven hundred fifty for approximately two trading days of history, and single-day display period provide balanced analysis.

For swing trading with multi-day holding periods, larger cluster sizes of three hundred to six hundred representing five to ten minute blocks reduce noise. Longer average lengths of seven fifty to fifteen hundred clusters capture broader patterns. Multi-day display periods of three to five days reveal accumulation and distribution over meaningful timeframes.

Interpreting Results
When the absorption to distribution ratio exceeds one point five, this suggests bullish underpinnings. Selling pressure is being absorbed, potentially indicating institutional accumulation. Traders should look for confirmation from hidden buy liquidity metrics, model probability favoring upside, and any bullish divergence signals.

When the ratio falls below zero point six seven, this suggests bearish underpinnings. Buying pressure is meeting distribution, potentially indicating institutional selling. Validate with hidden sell liquidity metrics, model probability favoring downside, and any bearish divergence signals.

When the ratio falls between zero point eight and one point two, the market is in relative equilibrium. Traders should wait for the ratio to break out of this neutral range, watch for exceptional tier events that might signal a shift, or wait for divergence to develop.

Regarding model predictions, when accuracy exceeds fifty-eight percent and sign agreement exceeds fifty-five percent, there is a strong predictive relationship. CVD analysis provides genuine edge for this instrument. When accuracy falls between fifty-four and fifty-eight percent or sign agreement falls between fifty-two and fifty-five percent, there is moderate edge. Use signals for confirmation but not as standalone entry triggers. When both metrics fall below their respective thresholds, the relationship is weak or random. Traders should reconsider whether CVD analysis adds value for this particular instrument.

Best Practices
Allow adequate training time before relying on model predictions. The prediction model requires substantial data to train effectively. Ensure at least five hundred clusters have accumulated before trusting model outputs. The indicator displays training sample count for verification.

Always validate model quality before trading based on predictions. A fifty-two percent accuracy is statistically indistinguishable from random chance. Ensure your edge is real by checking all validation metrics.

Context matters tremendously in interpretation. Absorption during an established uptrend suggests continuation strength. Absorption during a downtrend suggests potential reversal. Always interpret signals within the broader market context rather than in isolation.

Combine this indicator with price action analysis. The CVD analysis reveals hidden dynamics but should not be used alone. Combine with support and resistance levels, trend structure analysis, volume profile, and traditional technical patterns for comprehensive market assessment.

Monitor for regime changes over time. Market microstructure can change as participation patterns evolve. Regularly review bucket analysis to ensure the CVD-price relationship remains stable. Significant deterioration in predictive patterns may indicate changing market conditions requiring parameter recalibration.

Value to the Trading Community
This indicator democratizes institutional-grade analysis. Historically, this level of order flow analysis required expensive specialized platforms that cost hundreds or thousands of dollars monthly. By implementing these concepts within TradingView Pine Script, this tool makes professional analysis accessible to all traders regardless of budget.

The indicator serves as an educational framework. Beyond practical trading applications, the visible statistics help traders understand the CVD-price relationship. Bucket analysis teaches probabilistic thinking. Model coefficients reveal which factors matter most. Validation metrics prevent overconfidence in unreliable signals.

The customization depth accommodates diverse trading styles. With over thirty configurable parameters, the indicator adapts to virtually any approach from rapid scalping to patient swing trading.

The transparent methodology builds trust. Unlike black-box commercial solutions where algorithms remain hidden, every calculation is visible in the source code. Traders can verify the logic, understand the assumptions, and modify the approach to suit their specific needs.

Conclusion
The CVD Absorption and Distribution Pro v3 represents a significant advancement in accessible order flow analysis for retail traders. By combining time-tested CVD concepts with modern statistical validation and machine learning techniques, it provides a comprehensive toolkit for understanding the hidden dynamics driving price action.

Its value lies not merely in generating trading signals but in providing the framework to understand why those signals occur and whether they are statistically meaningful for the specific instrument being traded. This combination of actionable intelligence and educational transparency makes it an invaluable addition to any serious trader analytical arsenal.

The indicator rewards those who invest time in understanding its methodology, optimizing its parameters for their specific trading style, and validating its signals against their own market experience. Used thoughtfully, it reveals the institutional footprints that remain invisible on conventional charts. The absorption, distribution, and hidden liquidity patterns it detects often presage significant market movements, giving attentive traders the opportunity to position themselves alongside smart money rather than against it.
Informacje o Wersji
Now calculates probability of Price Up/down for current session not cluster.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.