OPEN-SOURCE SCRIPT
Z-Score Volume with CVD Clustering

Script Title:
Z-Score Volume with CVD Clustering & NY VWAP
📘 Description:
This indicator combines statistical volume analysis with order flow confirmation to detect high-probability trade zones and volume-based divergences.
📌 Components:
Z-Score of Volume: Identifies statistically significant volume surges or drops relative to a moving average baseline.
Cumulative Volume Delta (CVD): Gauges net buying vs. selling pressure using high-frequency bid/ask delta.
K-Means Clustering: Applies clustering logic to classify each bar into:
Cluster 2 – Strong Bullish: Z-Score and CVD both strong
Cluster 1 – Divergence / Bull Trap: Z-Score high, but weak CVD
Cluster 0 – Neutral / Noise: No clear alignment
Anchored VWAP (NY Session Open): Confirms market structure and institutional trend bias from 9:30 AM ET forward.
🎯 Suggested Applications:
✅ 1. Trend Continuation Entries (Add-ons):
Look to add to positions when:
Cluster 2 signal occurs
Price is above the NY session VWAP
Price structure has broken out of prior day high/low or range
⚠️ 2. Divergence Detection (Fade Traps):
Cluster 1 signals a bearish divergence (e.g., high volume but weak CVD).
Especially useful when price is failing to stay above VWAP.
Useful for early exits or reversal setups.
📊 3. Volume Profile Confirmation:
Combine with fixed or session-based volume profile tools.
Use Z-Score clusters to confirm volume spikes into low-volume nodes (LVNs) or during imbalance transitions.
📍 4. VWAP Structure Confirmation:
Anchored VWAP acts as a dynamic reference point.
Helps confirm acceptance vs. rejection zones at key institutional levels.
📈 Visuals & Alerts:
Color-coded volume bars show intensity of Z-Score & CVD confluence
CVD Line plots real-time delta bias with green/red coloring
Cluster-based shape markers highlight key bars for actionable signals
Optional: Add alerts for Cluster 2 above VWAP or Cluster 1 below VWAP
⚙️ Customization Options:
Adjustable Z-Score length
Custom anchor timeframe for CVD (e.g., 1D or sessions)
Adjustable max lookback depth
Toggle VWAP inclusion
Extendable to include additional filters: RSI, structure break alerts, etc.
🔧 Ideal Use Cases:
NY session intraday traders (ES, NQ, CL, 6E, FX pairs)
Breakout traders wanting order flow confirmation
Mean reversion traders spotting fake moves
Volume-based scalpers looking for edge on short-term order imbalance
Z-Score Volume with CVD Clustering & NY VWAP
📘 Description:
This indicator combines statistical volume analysis with order flow confirmation to detect high-probability trade zones and volume-based divergences.
📌 Components:
Z-Score of Volume: Identifies statistically significant volume surges or drops relative to a moving average baseline.
Cumulative Volume Delta (CVD): Gauges net buying vs. selling pressure using high-frequency bid/ask delta.
K-Means Clustering: Applies clustering logic to classify each bar into:
Cluster 2 – Strong Bullish: Z-Score and CVD both strong
Cluster 1 – Divergence / Bull Trap: Z-Score high, but weak CVD
Cluster 0 – Neutral / Noise: No clear alignment
Anchored VWAP (NY Session Open): Confirms market structure and institutional trend bias from 9:30 AM ET forward.
🎯 Suggested Applications:
✅ 1. Trend Continuation Entries (Add-ons):
Look to add to positions when:
Cluster 2 signal occurs
Price is above the NY session VWAP
Price structure has broken out of prior day high/low or range
⚠️ 2. Divergence Detection (Fade Traps):
Cluster 1 signals a bearish divergence (e.g., high volume but weak CVD).
Especially useful when price is failing to stay above VWAP.
Useful for early exits or reversal setups.
📊 3. Volume Profile Confirmation:
Combine with fixed or session-based volume profile tools.
Use Z-Score clusters to confirm volume spikes into low-volume nodes (LVNs) or during imbalance transitions.
📍 4. VWAP Structure Confirmation:
Anchored VWAP acts as a dynamic reference point.
Helps confirm acceptance vs. rejection zones at key institutional levels.
📈 Visuals & Alerts:
Color-coded volume bars show intensity of Z-Score & CVD confluence
CVD Line plots real-time delta bias with green/red coloring
Cluster-based shape markers highlight key bars for actionable signals
Optional: Add alerts for Cluster 2 above VWAP or Cluster 1 below VWAP
⚙️ Customization Options:
Adjustable Z-Score length
Custom anchor timeframe for CVD (e.g., 1D or sessions)
Adjustable max lookback depth
Toggle VWAP inclusion
Extendable to include additional filters: RSI, structure break alerts, etc.
🔧 Ideal Use Cases:
NY session intraday traders (ES, NQ, CL, 6E, FX pairs)
Breakout traders wanting order flow confirmation
Mean reversion traders spotting fake moves
Volume-based scalpers looking for edge on short-term order imbalance
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。