OPEN-SOURCE SCRIPT
Volume Clustering

This Volume Clustering script is a powerful tool for analyzing intraday trading dynamics by combining two key metrics: volume Z-Score and Cumulative Volume Delta (CVD). By categorizing market activity into distinct clusters, it helps you identify high-conviction trading opportunities and understand underlying market pressure.
How It Works
The script operates on a simple, yet effective, premise: it classifies each trading bar based on its statistical significance (volume Z-Score) and buying/selling pressure (CVD).
Volume Z-Score
The volume Z-Score measures how far the current bar's volume is from its average, helping to identify periods of unusually high or low volume. This metric is a powerful way to spot when institutional or large players might be entering the market. A high Z-Score suggests a significant event is taking place, regardless of direction.
Cumulative Volume Delta (CVD)
CVD tracks the net buying and selling pressure across different timeframes. The script uses a lower timeframe (e.g., 1-minute) and anchors it to a higher timeframe (e.g., 1-day) to capture intraday pressure. A positive CVD indicates more buying pressure, while a negative CVD suggests more selling pressure.
Cluster Categories
The script analyzes the confluence of these two metrics to assign a cluster to each bar, providing actionable insights. The clusters are color-coded and labeled to make them easy to interpret:
🟢 High Conviction Bullish: Unusually high volume (high Z-Score) combined with significant buying pressure (high CVD). This cluster suggests strong bullish momentum.
🔴 High Conviction Bearish: Unusually high volume (high Z-Score) coupled with significant selling pressure (low CVD). This cluster suggests strong bearish momentum.
🟡 Low Conviction/Noise: Low to moderate volume and mixed buying/selling pressure. This represents periods of indecision or consolidation, where market noise is more prevalent.
🟣 Other Clusters: The script also identifies other combinations, such as high volume with moderate CVD, or low volume with high CVD, which can provide additional context for understanding market dynamics.
Key Features & Customization
The script offers several customizable settings to tailor the analysis to your specific trading style:
Z-Score Lookback Length: Adjust the lookback period for calculating the average volume. A shorter period focuses on recent volume trends, while a longer period provides a broader context.
CVD Anchor & Lower Timeframe: Define the timeframes used for CVD calculation. You can anchor the analysis to a daily or weekly timeframe while using a lower timeframe (e.g., 1-minute) to capture granular intraday pressure.
High/Low Volume Mode: Toggle between "High Volume" mode (which uses 90th and 10th percentiles for clustering) and "Low Volume" mode (which uses 75th and 25th percentiles). This allows you to choose whether to focus on extreme events or more subtle shifts in market sentiment.
How It Works
The script operates on a simple, yet effective, premise: it classifies each trading bar based on its statistical significance (volume Z-Score) and buying/selling pressure (CVD).
Volume Z-Score
The volume Z-Score measures how far the current bar's volume is from its average, helping to identify periods of unusually high or low volume. This metric is a powerful way to spot when institutional or large players might be entering the market. A high Z-Score suggests a significant event is taking place, regardless of direction.
Cumulative Volume Delta (CVD)
CVD tracks the net buying and selling pressure across different timeframes. The script uses a lower timeframe (e.g., 1-minute) and anchors it to a higher timeframe (e.g., 1-day) to capture intraday pressure. A positive CVD indicates more buying pressure, while a negative CVD suggests more selling pressure.
Cluster Categories
The script analyzes the confluence of these two metrics to assign a cluster to each bar, providing actionable insights. The clusters are color-coded and labeled to make them easy to interpret:
🟢 High Conviction Bullish: Unusually high volume (high Z-Score) combined with significant buying pressure (high CVD). This cluster suggests strong bullish momentum.
🔴 High Conviction Bearish: Unusually high volume (high Z-Score) coupled with significant selling pressure (low CVD). This cluster suggests strong bearish momentum.
🟡 Low Conviction/Noise: Low to moderate volume and mixed buying/selling pressure. This represents periods of indecision or consolidation, where market noise is more prevalent.
🟣 Other Clusters: The script also identifies other combinations, such as high volume with moderate CVD, or low volume with high CVD, which can provide additional context for understanding market dynamics.
Key Features & Customization
The script offers several customizable settings to tailor the analysis to your specific trading style:
Z-Score Lookback Length: Adjust the lookback period for calculating the average volume. A shorter period focuses on recent volume trends, while a longer period provides a broader context.
CVD Anchor & Lower Timeframe: Define the timeframes used for CVD calculation. You can anchor the analysis to a daily or weekly timeframe while using a lower timeframe (e.g., 1-minute) to capture granular intraday pressure.
High/Low Volume Mode: Toggle between "High Volume" mode (which uses 90th and 10th percentiles for clustering) and "Low Volume" mode (which uses 75th and 25th percentiles). This allows you to choose whether to focus on extreme events or more subtle shifts in market sentiment.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.