OPEN-SOURCE SCRIPT
מעודכן Burst Size Flow Divergence Large vs Small CVD

Overview
A single cumulative-delta line tells you net buying or selling, but hides who is doing the pushing. Burst-Size Flow Divergence splits the flow inside each bar by the size of each volume burst — small / medium / large sub-intervals — and runs a separate signed delta on each tier. The signal is the divergence between the large-burst delta and the small-burst delta: concentrated bursts leaning one way while trickle flow leans the other. It is a flow-structure read, not a signal to trade alone.
What this is — and is NOT (read this before using)
This measures activity-burst size, not per-trade size. Pine cannot see individual trades — it sees a bar's volume and, via lower-timeframe requests, the volume of each sub-interval within the bar. "Large" here means a sub-interval that printed a lot of volume relative to normal — not a large single trade, and not "institutional." Institutions deliberately slice big orders into many small child-orders, so burst size is a proxy, not proof of who is behind the flow. The classification is honest about this, and the built-in harness is there precisely to test whether the divergence carries any information rather than to assert that it does.
Why these components are ONE tool (mashup justification)
Each stage exists because the previous one is ambiguous on its own:
Intrabar bucketing. Each lower-timeframe sub-bar is classed small/medium/large by its volume against an adaptive average, so "large" means large for this symbol and session, not a fixed lot count. A fixed threshold would misclassify on every instrument and every volatility regime.
Per-tier directional imbalance. Each tier gets its own signed delta (up sub-bar → +volume, down → −volume), expressed as net ÷ gross in [−1, +1] — what fraction of that tier was net buying versus selling. Normalising this way lets the tiers' directions be compared apples-to-apples even though the large tier moves far less total volume than the small one.
The divergence. The large-minus-small spread is the object. Three separate delta lines would just be clutter to eyeball; the disagreement between the concentrated and the trickle flow is the actual read, so the tool computes it directly.
The calibration harness. "Concentrated bursts are informed" is a hypothesis, not a law — so when the spread is strong, the harness checks forward whether price actually followed the large tier more than the unconditional base rate, and reports Hit / Base / Edge on confirmed bars. That's what turns the divergence from a story into something you can verify on your instrument.
How it works
For each chart bar the finest available sub-bars are requested. Each is signed by close-versus-open (a tick-rule aggressor proxy) and bucketed by volume against the adaptive average. Per-tier signed volume becomes a net÷gross imbalance in [−1, +1], the large-minus-small spread is smoothed into the oscillator, and a strong gated spread is the divergence signal.
How to use it
Read the histogram (the large-minus-small spread): green means large bursts are accumulating while small flow lags or sells; red means large bursts are distributing. The bold line is the large-tier imbalance, the faint line the small tier. A gated turn in the spread suggests concentrated flow is leading, and is marked in the pane and — optionally — on the price chart. Always check the Coverage row (how much real sub-bar resolution the current bar received) and the Edge row (whether the divergence has actually led on this instrument). It is never a standalone trigger.
Plan-adaptive & data note
Sub-bar precision auto-selects the finest your plan serves (seconds on Premium+, else 1-minute). Lower-timeframe data exists only for recent bars, so older bars fall back to whole-bar flow and the coverage read shows it. The tool needs an instrument with real volume — a cash index reports none, so use the futures. The adaptive average and the calibration harness advance only on confirmed bars, so they never drift or inflate intrabar. Edge is in-sample, no costs — a study aid, not a backtest.
Originality
The parts are public: cumulative volume delta, the close-vs-open (tick-rule) aggressor proxy, and the general idea of size-partitioned / flow-toxicity order flow. What's assembled here is the specific construction — the adaptive intrabar size-tiering, the net÷gross per-tier imbalance that makes tiers of very different volume directly comparable, the large-minus-small divergence as the headline object, and the forward-calibration harness that scores it against the base rate. This is a clean-room implementation; no third-party Pine code is reused.
Concept credits
Cumulative Volume Delta — standard order-flow technique.
Close-vs-open (tick-rule) aggressor classification — after the classic trade-sign literature (Lee & Ready).
Size-partitioned / flow-toxicity order flow (VPIN) — Easley, López de Prado & O'Hara.
Disclaimer
Research and educational tool only. Not financial advice, no recommendation, no guarantee of results. Burst size is not trade size and does not identify institutions versus retail; the up/down sign is a close-vs-open proxy for the aggressor, not the true tape. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability.
A single cumulative-delta line tells you net buying or selling, but hides who is doing the pushing. Burst-Size Flow Divergence splits the flow inside each bar by the size of each volume burst — small / medium / large sub-intervals — and runs a separate signed delta on each tier. The signal is the divergence between the large-burst delta and the small-burst delta: concentrated bursts leaning one way while trickle flow leans the other. It is a flow-structure read, not a signal to trade alone.
What this is — and is NOT (read this before using)
This measures activity-burst size, not per-trade size. Pine cannot see individual trades — it sees a bar's volume and, via lower-timeframe requests, the volume of each sub-interval within the bar. "Large" here means a sub-interval that printed a lot of volume relative to normal — not a large single trade, and not "institutional." Institutions deliberately slice big orders into many small child-orders, so burst size is a proxy, not proof of who is behind the flow. The classification is honest about this, and the built-in harness is there precisely to test whether the divergence carries any information rather than to assert that it does.
Why these components are ONE tool (mashup justification)
Each stage exists because the previous one is ambiguous on its own:
Intrabar bucketing. Each lower-timeframe sub-bar is classed small/medium/large by its volume against an adaptive average, so "large" means large for this symbol and session, not a fixed lot count. A fixed threshold would misclassify on every instrument and every volatility regime.
Per-tier directional imbalance. Each tier gets its own signed delta (up sub-bar → +volume, down → −volume), expressed as net ÷ gross in [−1, +1] — what fraction of that tier was net buying versus selling. Normalising this way lets the tiers' directions be compared apples-to-apples even though the large tier moves far less total volume than the small one.
The divergence. The large-minus-small spread is the object. Three separate delta lines would just be clutter to eyeball; the disagreement between the concentrated and the trickle flow is the actual read, so the tool computes it directly.
The calibration harness. "Concentrated bursts are informed" is a hypothesis, not a law — so when the spread is strong, the harness checks forward whether price actually followed the large tier more than the unconditional base rate, and reports Hit / Base / Edge on confirmed bars. That's what turns the divergence from a story into something you can verify on your instrument.
How it works
For each chart bar the finest available sub-bars are requested. Each is signed by close-versus-open (a tick-rule aggressor proxy) and bucketed by volume against the adaptive average. Per-tier signed volume becomes a net÷gross imbalance in [−1, +1], the large-minus-small spread is smoothed into the oscillator, and a strong gated spread is the divergence signal.
How to use it
Read the histogram (the large-minus-small spread): green means large bursts are accumulating while small flow lags or sells; red means large bursts are distributing. The bold line is the large-tier imbalance, the faint line the small tier. A gated turn in the spread suggests concentrated flow is leading, and is marked in the pane and — optionally — on the price chart. Always check the Coverage row (how much real sub-bar resolution the current bar received) and the Edge row (whether the divergence has actually led on this instrument). It is never a standalone trigger.
Plan-adaptive & data note
Sub-bar precision auto-selects the finest your plan serves (seconds on Premium+, else 1-minute). Lower-timeframe data exists only for recent bars, so older bars fall back to whole-bar flow and the coverage read shows it. The tool needs an instrument with real volume — a cash index reports none, so use the futures. The adaptive average and the calibration harness advance only on confirmed bars, so they never drift or inflate intrabar. Edge is in-sample, no costs — a study aid, not a backtest.
Originality
The parts are public: cumulative volume delta, the close-vs-open (tick-rule) aggressor proxy, and the general idea of size-partitioned / flow-toxicity order flow. What's assembled here is the specific construction — the adaptive intrabar size-tiering, the net÷gross per-tier imbalance that makes tiers of very different volume directly comparable, the large-minus-small divergence as the headline object, and the forward-calibration harness that scores it against the base rate. This is a clean-room implementation; no third-party Pine code is reused.
Concept credits
Cumulative Volume Delta — standard order-flow technique.
Close-vs-open (tick-rule) aggressor classification — after the classic trade-sign literature (Lee & Ready).
Size-partitioned / flow-toxicity order flow (VPIN) — Easley, López de Prado & O'Hara.
Disclaimer
Research and educational tool only. Not financial advice, no recommendation, no guarantee of results. Burst size is not trade size and does not identify institutions versus retail; the up/down sign is a close-vs-open proxy for the aggressor, not the true tape. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability.
הערות שחרור
Burst-Size Flow Divergence v1.1The "divergence leads" Edge now carries a Wilson 95% lower bound, and the panel turns green only when that bound clears zero with an adequate sample.
The existing caveat about burst size being a proxy rather than proof of participant identity still stands, and it is worth reading alongside the bound: a wide interval on a proxy measure warrants more caution than a wide interval on a direct one.
The tier-splitting logic, per-tier signed cumulative delta and divergence construction are unchanged. Edge figures remain in-sample and without costs.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.