OPEN-SOURCE SCRIPT
更新済 Cumulative Volume Delta Flow [AGPro Series]

Cumulative Volume Delta Flow [AGPro Series]
🔹 **Overview**
Cumulative Volume Delta Flow is a hybrid CVD engine designed to expose order-flow imbalances without requiring footprint charts or exchange-native buy/sell data. It reconstructs cumulative delta using lower-timeframe breakdown when available, with intrabar polarity as a universal fallback — making it work on every symbol and every timeframe. On top of this engine, a triple-layer divergence detector identifies Regular, Hidden, and statistical Exhaustion signals, and every signal is scored by its own statistical strength with a ★/★★/★★★ rating system printed directly on the label.
The indicator is built for traders who want smart-money context at a glance: when buyers are absorbing, when a rally is losing real participation, and when a climactic flush is likely to reverse — with an immediate visual cue of how strong each signal is relative to the recent flow regime.

🔹 **Unique Edge**
Most CVD indicators are single-mode: either they plot cumulative delta, or they call a Regular divergence. This script combines four layers that rarely appear together in one tool:
- Hybrid engine with transparent fallback (no silent failure on high TFs)
- Exhaustion detection based on standard-deviation of CVD change, not price — catches reversals that price-only divergence misses
- Per-signal ★/★★/★★★ strength rating using type-specific statistical metrics (pivot-gap σ for Regular/Hidden, change σ for Exhaustion), so traders instantly know which signals deserve attention
- Optional reaction zones anchored at flow-driven pivots, behaving as dynamic support/resistance born from real participation events rather than pure price structure
🔹 **Methodology**
- The engine computes two parallel delta streams every bar: an intrabar polarity stream (weighted by wick balance for neutral/doji candles) and a lower-timeframe stream that iterates sub-bars and signs each by its close-vs-open direction
- In Hybrid mode, the LTF stream is preferred when it yields a non-zero value; the intrabar stream is used as fallback so the indicator never goes blank on exotic tickers or high timeframes
- A session/daily/weekly reset prevents long-run drift and keeps the cumulative counter meaningful across regime changes
- Pivots are detected on both price and CVD with a shared lookback window; the last two price pivots and their paired CVD values are tested for all four classical divergence relationships
- Exhaustion is a separate statistical trigger: the single-bar CVD change is compared against a 50-bar standard deviation; a σ breach in the direction opposite to the candle body is flagged as climactic absorption
- Each divergence label is rated with stars based on its type: Regular and Hidden use the CVD-pivot gap normalized by 50-bar CVD level stdev (how far apart the two flow pivots are), while Exhaustion uses the σ multiple of the current CVD change (how extreme the climactic event is)
- A cooldown window suppresses signal clustering in chop, and labels are offset by ATR-scaled distance with a leader line so they never collide with candles
🔹 **Signals & Alerts**
On-chart labels with star rating:
- Reg Bull / Reg Bear ★-★★★ — classical reversal divergence (price exhausts, flow refuses)
- Hid Bull / Hid Bear ★-★★★ — continuation divergence (pullback inside an active trend)
- Exh Bull / Exh Bear ★-★★★ — statistical flow climax above the σ threshold
Star thresholds for Regular/Hidden: ★★★ ≥ 2.0σ gap, ★★ ≥ 1.0σ gap, ★ < 1.0σ.
Star thresholds for Exhaustion: ★★★ ≥ 3.0σ, ★★ ≥ 2.0σ, ★ < 2.0σ (minimum trigger is 1.75σ).
Each signal carries its own color code and a leader line connecting the label back to the source candle for fast visual reading. Six discrete alertcondition slots are exposed plus three proactive alert() calls grouped by divergence family, so traders can route regular, hidden, and exhaustion signals to different channels.
🔹 **Key Inputs**
- Calculation Method: Hybrid, LTF Only, or Intrabar Only
- LTF Resolution: Auto (adaptive by chart TF) or fixed 1 / 3 / 5 / 15m
- CVD Reset: Session, Daily, Weekly, or None
- Pivot Length: 2–15 bars
- Toggles for Regular / Hidden / Exhaustion layers independently
- Exhaustion Threshold (σ): 1.0–4.0, default 1.75
- Min Bars Between Signals: anti-clustering cooldown (default 15)
- Reaction Zones: optional, with ATR width, extend length, and max active cap
- Label Size + Label Offset (ATR) for visual tuning
- Info Panel: 5 positions, 4 text sizes, full hide toggle
🔹 **How to Use**
- On the 4H timeframe, run the defaults on liquid instruments: BTCUSDT, ETHUSDT, SPX, ES, major FX pairs
- Treat ★★★ signals as the highest-priority reads of the chart — these are statistical outliers
- Treat ★★ signals as the normal tradeable population — the bulk of decision-making happens here
- Treat ★ signals as background context — use them for bias confirmation, not as primary entries
- Regular divergences are reversal warnings at structural highs/lows; they are most reliable when aligned with a key horizontal level or trendline
- Hidden divergences are trend-continuation entries during pullbacks inside a confirmed trend
- Exhaustion signals mark participation climaxes and often coincide with short-term reversals even when no classical pivot has formed yet
- Check the Info Panel's Last Signal row for the most recent event type and its star rating without scanning the chart
- Enable Reaction Zones when you want persistent S/R context from flow events; keep them off for minimal, label-only use
- Consider combining with a structure tool from the AGPro Series (SFP, Breaker, Unicorn) for confluence
🔹 **Info Panel**
The compact info panel on the chart surfaces seven live metrics: the current cumulative CVD value, the CVD trend classification (Up/Down/Flat based on price relative to its own EMA 21), the last signal's full name and star rating in color, the rolling divergence count over the last 200 bars (Bull / Bear), and the bar-age of the most recent bullish and bearish events. This gives a full situational snapshot without scrolling.
🔹 **Limitations & Transparency**
- CVD from intrabar polarity is an approximation, not true tick-level order flow. Exchange-native buy/sell volume is only available through footprint data
- On very high timeframes (Daily+), LTF breakdown may return partial data; Hybrid mode is recommended
- Divergence signals appear only after both pivot legs are confirmed; the second pivot needs `pivotLen` bars of right-side confirmation, so signals print with that lag
- Exhaustion requires at least 50 bars of CVD history for the standard-deviation baseline
- Star ratings are statistical descriptors of signal strength relative to recent flow, not trade-quality guarantees
- Past performance of any divergence pattern does not guarantee future results; this tool surfaces probabilistic context, not guaranteed reversals
🔹 **Risk Disclosure**
This indicator is an analytical framework, not a trading system or financial advice. Signals are technical observations intended to support decision-making; they do not account for fundamentals, news, liquidity, or your risk tolerance. Always use proper position sizing, stop-loss placement, and risk management. Test the tool on historical data and in a simulated environment before deploying it on live capital. Trading carries risk of substantial loss.
🔹 **Overview**
Cumulative Volume Delta Flow is a hybrid CVD engine designed to expose order-flow imbalances without requiring footprint charts or exchange-native buy/sell data. It reconstructs cumulative delta using lower-timeframe breakdown when available, with intrabar polarity as a universal fallback — making it work on every symbol and every timeframe. On top of this engine, a triple-layer divergence detector identifies Regular, Hidden, and statistical Exhaustion signals, and every signal is scored by its own statistical strength with a ★/★★/★★★ rating system printed directly on the label.
The indicator is built for traders who want smart-money context at a glance: when buyers are absorbing, when a rally is losing real participation, and when a climactic flush is likely to reverse — with an immediate visual cue of how strong each signal is relative to the recent flow regime.
🔹 **Unique Edge**
Most CVD indicators are single-mode: either they plot cumulative delta, or they call a Regular divergence. This script combines four layers that rarely appear together in one tool:
- Hybrid engine with transparent fallback (no silent failure on high TFs)
- Exhaustion detection based on standard-deviation of CVD change, not price — catches reversals that price-only divergence misses
- Per-signal ★/★★/★★★ strength rating using type-specific statistical metrics (pivot-gap σ for Regular/Hidden, change σ for Exhaustion), so traders instantly know which signals deserve attention
- Optional reaction zones anchored at flow-driven pivots, behaving as dynamic support/resistance born from real participation events rather than pure price structure
🔹 **Methodology**
- The engine computes two parallel delta streams every bar: an intrabar polarity stream (weighted by wick balance for neutral/doji candles) and a lower-timeframe stream that iterates sub-bars and signs each by its close-vs-open direction
- In Hybrid mode, the LTF stream is preferred when it yields a non-zero value; the intrabar stream is used as fallback so the indicator never goes blank on exotic tickers or high timeframes
- A session/daily/weekly reset prevents long-run drift and keeps the cumulative counter meaningful across regime changes
- Pivots are detected on both price and CVD with a shared lookback window; the last two price pivots and their paired CVD values are tested for all four classical divergence relationships
- Exhaustion is a separate statistical trigger: the single-bar CVD change is compared against a 50-bar standard deviation; a σ breach in the direction opposite to the candle body is flagged as climactic absorption
- Each divergence label is rated with stars based on its type: Regular and Hidden use the CVD-pivot gap normalized by 50-bar CVD level stdev (how far apart the two flow pivots are), while Exhaustion uses the σ multiple of the current CVD change (how extreme the climactic event is)
- A cooldown window suppresses signal clustering in chop, and labels are offset by ATR-scaled distance with a leader line so they never collide with candles
🔹 **Signals & Alerts**
On-chart labels with star rating:
- Reg Bull / Reg Bear ★-★★★ — classical reversal divergence (price exhausts, flow refuses)
- Hid Bull / Hid Bear ★-★★★ — continuation divergence (pullback inside an active trend)
- Exh Bull / Exh Bear ★-★★★ — statistical flow climax above the σ threshold
Star thresholds for Regular/Hidden: ★★★ ≥ 2.0σ gap, ★★ ≥ 1.0σ gap, ★ < 1.0σ.
Star thresholds for Exhaustion: ★★★ ≥ 3.0σ, ★★ ≥ 2.0σ, ★ < 2.0σ (minimum trigger is 1.75σ).
Each signal carries its own color code and a leader line connecting the label back to the source candle for fast visual reading. Six discrete alertcondition slots are exposed plus three proactive alert() calls grouped by divergence family, so traders can route regular, hidden, and exhaustion signals to different channels.
🔹 **Key Inputs**
- Calculation Method: Hybrid, LTF Only, or Intrabar Only
- LTF Resolution: Auto (adaptive by chart TF) or fixed 1 / 3 / 5 / 15m
- CVD Reset: Session, Daily, Weekly, or None
- Pivot Length: 2–15 bars
- Toggles for Regular / Hidden / Exhaustion layers independently
- Exhaustion Threshold (σ): 1.0–4.0, default 1.75
- Min Bars Between Signals: anti-clustering cooldown (default 15)
- Reaction Zones: optional, with ATR width, extend length, and max active cap
- Label Size + Label Offset (ATR) for visual tuning
- Info Panel: 5 positions, 4 text sizes, full hide toggle
🔹 **How to Use**
- On the 4H timeframe, run the defaults on liquid instruments: BTCUSDT, ETHUSDT, SPX, ES, major FX pairs
- Treat ★★★ signals as the highest-priority reads of the chart — these are statistical outliers
- Treat ★★ signals as the normal tradeable population — the bulk of decision-making happens here
- Treat ★ signals as background context — use them for bias confirmation, not as primary entries
- Regular divergences are reversal warnings at structural highs/lows; they are most reliable when aligned with a key horizontal level or trendline
- Hidden divergences are trend-continuation entries during pullbacks inside a confirmed trend
- Exhaustion signals mark participation climaxes and often coincide with short-term reversals even when no classical pivot has formed yet
- Check the Info Panel's Last Signal row for the most recent event type and its star rating without scanning the chart
- Enable Reaction Zones when you want persistent S/R context from flow events; keep them off for minimal, label-only use
- Consider combining with a structure tool from the AGPro Series (SFP, Breaker, Unicorn) for confluence
🔹 **Info Panel**
The compact info panel on the chart surfaces seven live metrics: the current cumulative CVD value, the CVD trend classification (Up/Down/Flat based on price relative to its own EMA 21), the last signal's full name and star rating in color, the rolling divergence count over the last 200 bars (Bull / Bear), and the bar-age of the most recent bullish and bearish events. This gives a full situational snapshot without scrolling.
🔹 **Limitations & Transparency**
- CVD from intrabar polarity is an approximation, not true tick-level order flow. Exchange-native buy/sell volume is only available through footprint data
- On very high timeframes (Daily+), LTF breakdown may return partial data; Hybrid mode is recommended
- Divergence signals appear only after both pivot legs are confirmed; the second pivot needs `pivotLen` bars of right-side confirmation, so signals print with that lag
- Exhaustion requires at least 50 bars of CVD history for the standard-deviation baseline
- Star ratings are statistical descriptors of signal strength relative to recent flow, not trade-quality guarantees
- Past performance of any divergence pattern does not guarantee future results; this tool surfaces probabilistic context, not guaranteed reversals
🔹 **Risk Disclosure**
This indicator is an analytical framework, not a trading system or financial advice. Signals are technical observations intended to support decision-making; they do not account for fundamentals, news, liquidity, or your risk tolerance. Always use proper position sizing, stop-loss placement, and risk management. Test the tool on historical data and in a simulated environment before deploying it on live capital. Trading carries risk of substantial loss.
リリースノート
UPDATE NOTES - v1.5This is a maintenance and presentation refresh.
The core purpose of the script remains unchanged. This release covers internal
cleanup only; it does not change how the script reads, calculates, or displays
order-flow information.
This script continues to function as an analytical and visualization tool. It
does not attempt to predict price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
- Internal source cleanup and version maintenance.
- No changes to the CVD engine, divergence detection, star-rating strength
model, reaction zones, or the information panel.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The hybrid CVD calculation, the Regular / Hidden / Exhaustion divergence
detection, the strength rating, and the panel all behave exactly as before.
Users should interpret outputs exactly the same way as in the previous version.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, and timeframe differences may
affect how divergences and flow events appear. Lower-timeframe buy/sell
breakdown availability also varies by symbol and timeframe. Outputs should
always be interpreted within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading outcomes. Users
remain responsible for their own decisions.
リリースノート
🔧 UPDATE NOTES - 1.6This update adds a live proof statistic, a next-action stance, and contrast-safe
label text to Cumulative Volume Delta Flow. The CVD engine and the regular,
hidden and exhaustion divergence logic remain unchanged. This script continues
to function as an analytical order-flow tool. It does not predict price direction
or provide guaranteed outcomes.
------------------------
What Changed
------------------------
- Signal Hit Rate (Proof Layer)
The panel now tracks how often a divergence is followed by a balanced move in
its own direction - one ATR target reached before the same distance against it.
Wins and losses are counted on confirmed bars only, same-bar ambiguity resolves
conservatively, and samples that resolve neither inside the window are left
uncounted, so the statistic stays honest and does not repaint.
- Next-Action Stance Row
A new Action row turns the freshest divergence and the CVD trend into a clear
stance - watch up, watch down, or wait for the next divergence.
- Contrast-Safe Label Text
A luminance helper now sets divergence label text color, so pink, amber and
indigo labels stay clearly readable.
- Safer Volatility Handling
The ATR baseline is now guarded against missing values for steadier label and
zone spacing on thin or early data.
------------------------
Visual Improvements
------------------------
- Clearer regular, hidden and exhaustion labels
- Kept the CVD area, EMA signal line and optional reaction zones intact
- Merged the bull/bear timing into a single compact panel row
- No added chart clutter
------------------------
Interface & Usability
------------------------
- Added Signal Hit Rate and Action rows to the panel
- Kept the existing CVD, Trend, Last Signal and divergence-count rows
- Preserved all existing settings and defaults as backward compatible
- Enhanced overall experience without changing the core engine
------------------------
Behavior Notes
------------------------
This update does not change how CVD or divergences are calculated. The Signal Hit
Rate is a descriptive, backward-looking statistic of past divergences, not a
forward prediction. Outputs should be interpreted the same way as before.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool. Volatility, liquidity and
timeframe differences can affect how divergences and statistics appear. Always
interpret outputs within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only. It does not provide
financial advice or guaranteed trading outcomes. Users remain responsible for
their own decisions.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。