OPEN-SOURCE SCRIPT
Telah dikemas kini Adaptive Volume-Delta Score (VDS) | Order-Flow & Divergence

The Adaptive Volume-Delta Score (VDS) is a technical analysis tool for the statistical classification of volume-delta activity. It utilizes an Adaptive-Switch Logic that toggles between historical bar reconstruction (request.security_lower_tf) and a real-time Rolling-Window Live-Tracker.
🛠 Core Functionality
1. The VDS Engine (Statistical Mapping)
Wick-Weighted Delta: The calculation is based on wick-weighting: (close-open)/range * volume. This weights the delta according to price displacement within the bar.
Symmetrical Mapping (-4.5 to 4.5): Raw values are statistically categorized via ta.percentrank and mapped onto a fixed scale.
+4.5 (100% Rank): The absolute maximum within the chosen lookback period.
+2.25 (75% Rank): Significant activity relative to the period.
0 (Median): The statistical midpoint (50% Rank).
-4.5 (0% Rank / Min.): The absolute floor of activity for the period.
Visualization Logic: This mapping is primarily used to plot volume activity and delta aggression within the same visual space, providing a consistent reference frame for comparing relative dominance.
Context Dependency: Signals are not absolute recommendations. The significance depends heavily on the Lookback Period, Thresholds, and the specific market environment.
2. Adaptive Logic & Data Integrity
Signal-Bridge: On lower timeframes (LTF), the indicator simulates the behavior of the Main Timeframe (Main-TF) using a rolling window. This allows for the observation of delta development while the bar is still forming.
🛡️ Integrity Dashboard: Visualizes the statistical consistency between live data and the historical baseline. Deviations (e.g., due to Pine Script's 5000-bar limit) are displayed transparently as warnings.
3. Dynamic Alert System
Automation: Alerts utilize the alert() function with the "Any function call" setting.
Intelligence: Messages are fully dynamic, reporting the mode (Live vs. History), signal type, safeguard status, and data integrity.
🚀 Quick Calibration Guide
Sensitivity: A longer Lookback Period stabilizes the statistics; a shorter period makes the score more reactive to short-term volume spikes.
Threshold Setup: Calibrate the Dominance Threshold (default 3.0) to isolate extreme aggression. Use the Volume Threshold to ensure a minimum level of market participation.
Visual Match: Activate the Price Chart Overlays and adjust your thresholds until the markers (Diamonds) correspond with your individual market interpretation.
Dashboard Check: Monitor the Confidence Score. If red warning values appear, consider adjusting your Lookback or Timeframe to maintain a stable statistical foundation.
🎨 Visual Guide: Understanding the Scale
Navy/Blue Columns: Standard activity within the selected statistical window.
Gray Columns: Phases below the Low Volume Threshold, indicating low relative market participation.
Lime/Fuchsia (Dominance): Occurs when volume and delta simultaneously exceed the defined thresholds (Aggression).
Olive/Maroon (Divergence): Period delta is positive/negative while price action is opposite (Decoupling/Absorption).
Diamonds: Optional projection of oscillator signals directly onto the candles in the price chart.
⚠️ Important Technical Notifications
The "Signal Bridge" (Rolling vs. Fixed Window):
HTF-Request Mode (Fixed): Measures delta starting from the candle open (e.g., 12:00 PM).
Live-Transfer Mode (Rolling): Analyzes a sliding window (e.g., the last 120 minutes). This provides a Lead-Time Advantage, detecting aggression as it happens regardless of the HTF clock. Both modes converge at the HTF bar close.
Data Integrity & Anomalies:
Session Gaps: High Main-TFs (like D1) can be affected by irregular session hours (e.g., Forex Sunday). Always monitor the Confidence Score (🛡️).
Replay Mode:
Displays "No Stat. Control" if historical LTF data is unavailable. We prioritize data honesty over estimated data.
🔔 How to set Alerts (Smart Signals)
Preparation: Open the VDS settings. Under "Alert Settings", choose which signals should trigger: Dominance, Divergence, or both.
Condition: Select "Adaptive Volume-Delta Score...".
Trigger Logic: Change setting to "Any alert() function call".
Frequency: Managed by the script (once_per_bar_close) to ensure statistical honesty.
Timeframe Choice: Use the Main-TF for final confirmed signals, or a Lower-Timeframe for Live-Tracker early warnings.
📊 Statistical Transparency (Data Window)
Raw metrics are displayed exclusively in the TradingView Data Window to keep the chart clean:
Runtime-Safe LTF: The analysis interval currently in use.
Max Safe Lookback: The mathematical limit for your current setup (5,000-bar ceiling).
Active Bar Limit: The actual usable data foundation.
Converted Sum of LTF Request Bars: The historical baseline used as an anchor for the Live-Tracker.
Relative Live-Data Size: Numerical basis of the Confidence Score (100% = Perfect Integrity).
Overall Requested Bars: Total data points analyzed within your Lookback Period.
🛠 Core Functionality
1. The VDS Engine (Statistical Mapping)
Wick-Weighted Delta: The calculation is based on wick-weighting: (close-open)/range * volume. This weights the delta according to price displacement within the bar.
Symmetrical Mapping (-4.5 to 4.5): Raw values are statistically categorized via ta.percentrank and mapped onto a fixed scale.
+4.5 (100% Rank): The absolute maximum within the chosen lookback period.
+2.25 (75% Rank): Significant activity relative to the period.
0 (Median): The statistical midpoint (50% Rank).
-4.5 (0% Rank / Min.): The absolute floor of activity for the period.
Visualization Logic: This mapping is primarily used to plot volume activity and delta aggression within the same visual space, providing a consistent reference frame for comparing relative dominance.
Context Dependency: Signals are not absolute recommendations. The significance depends heavily on the Lookback Period, Thresholds, and the specific market environment.
2. Adaptive Logic & Data Integrity
Signal-Bridge: On lower timeframes (LTF), the indicator simulates the behavior of the Main Timeframe (Main-TF) using a rolling window. This allows for the observation of delta development while the bar is still forming.
🛡️ Integrity Dashboard: Visualizes the statistical consistency between live data and the historical baseline. Deviations (e.g., due to Pine Script's 5000-bar limit) are displayed transparently as warnings.
3. Dynamic Alert System
Automation: Alerts utilize the alert() function with the "Any function call" setting.
Intelligence: Messages are fully dynamic, reporting the mode (Live vs. History), signal type, safeguard status, and data integrity.
🚀 Quick Calibration Guide
Sensitivity: A longer Lookback Period stabilizes the statistics; a shorter period makes the score more reactive to short-term volume spikes.
Threshold Setup: Calibrate the Dominance Threshold (default 3.0) to isolate extreme aggression. Use the Volume Threshold to ensure a minimum level of market participation.
Visual Match: Activate the Price Chart Overlays and adjust your thresholds until the markers (Diamonds) correspond with your individual market interpretation.
Dashboard Check: Monitor the Confidence Score. If red warning values appear, consider adjusting your Lookback or Timeframe to maintain a stable statistical foundation.
🎨 Visual Guide: Understanding the Scale
Navy/Blue Columns: Standard activity within the selected statistical window.
Gray Columns: Phases below the Low Volume Threshold, indicating low relative market participation.
Lime/Fuchsia (Dominance): Occurs when volume and delta simultaneously exceed the defined thresholds (Aggression).
Olive/Maroon (Divergence): Period delta is positive/negative while price action is opposite (Decoupling/Absorption).
Diamonds: Optional projection of oscillator signals directly onto the candles in the price chart.
⚠️ Important Technical Notifications
The "Signal Bridge" (Rolling vs. Fixed Window):
HTF-Request Mode (Fixed): Measures delta starting from the candle open (e.g., 12:00 PM).
Live-Transfer Mode (Rolling): Analyzes a sliding window (e.g., the last 120 minutes). This provides a Lead-Time Advantage, detecting aggression as it happens regardless of the HTF clock. Both modes converge at the HTF bar close.
Data Integrity & Anomalies:
Session Gaps: High Main-TFs (like D1) can be affected by irregular session hours (e.g., Forex Sunday). Always monitor the Confidence Score (🛡️).
Replay Mode:
Displays "No Stat. Control" if historical LTF data is unavailable. We prioritize data honesty over estimated data.
🔔 How to set Alerts (Smart Signals)
Preparation: Open the VDS settings. Under "Alert Settings", choose which signals should trigger: Dominance, Divergence, or both.
Condition: Select "Adaptive Volume-Delta Score...".
Trigger Logic: Change setting to "Any alert() function call".
Frequency: Managed by the script (once_per_bar_close) to ensure statistical honesty.
Timeframe Choice: Use the Main-TF for final confirmed signals, or a Lower-Timeframe for Live-Tracker early warnings.
📊 Statistical Transparency (Data Window)
Raw metrics are displayed exclusively in the TradingView Data Window to keep the chart clean:
Runtime-Safe LTF: The analysis interval currently in use.
Max Safe Lookback: The mathematical limit for your current setup (5,000-bar ceiling).
Active Bar Limit: The actual usable data foundation.
Converted Sum of LTF Request Bars: The historical baseline used as an anchor for the Live-Tracker.
Relative Live-Data Size: Numerical basis of the Confidence Score (100% = Perfect Integrity).
Overall Requested Bars: Total data points analyzed within your Lookback Period.
Nota Keluaran
v1.1 - Aggression Engine RefinementOptimization: Removed redundant volume-weighting from the Delta-Ranking.
Result: Improved responsiveness and lead-time. The VDS now detects high-conviction aggression earlier, specifically improving the detection of setups prior to a Break of Structure (BOS in the lower Timeframe).
Linear Scaling: The score now provides a more direct representation of market intent by focusing on the statistical rank of the volume-delta itself.
Source Code: Added direct links to the Adaptive Suite (IAI) and profile in the header for easier navigation.
Default optimization: Set High Volume Threshold to 0.0 (Median) for a more intuitive balance between aggression and participation.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.