OPEN-SOURCE SCRIPT
Flow & Analytics (Normalized)

Flow & Analytics (Normalized)
A multi‐metric lower‐pane indicator that condenses volume imbalances and flow dynamics into four normalized measures—Δ %, Ratio, Z-Score, and Cumulative Δ—plus optional buy/sell “flow” bars. All series are scaled to –1…+1 for direct comparison.
How to Add & Configure
Add the script to your chart (overlay = false).
In Settings → Inputs, toggle on/off the four metrics and the background flow bars.
Adjust look-back windows:
Flow Lookback controls how much history the bars normalize over.
Z Window sets the period for the Z-Score’s mean/standard deviation.
Cum Δ Lookback determines how reactive the cumulative Δ line is.
Choose colors, line widths, and opacity to match your style.
Reading the Metrics
Flow Bars (teal/green & red overlay):
Plotted as vertical columns from –1…+1, they show buy vs. sell pressure each bar.
The taller bar is drawn behind, the shorter in front—so you always see both sides of the fight.
Use: Quickly spot bars where one side dominates (e.g. an all-green or all-red bar).
Δ % (orange line, thick):
(
B
u
y
s
−
S
e
l
l
s
)
/
(
B
u
y
s
+
S
e
l
l
s
)
(Buys−Sells)/(Buys+Sells).
Measures net imbalance as a percentage of total flow.
Crosses of 0 indicate a shift from selling to buying pressure (or vice versa).
Values near ±1 reveal nearly pure one-sided flow.
Ratio (purple dashed):
Defined as
(
B
/
S
−
1
)
/
(
B
/
S
+
1
)
(B/S−1)/(B/S+1), which algebraically equals Δ %.
Plotted separately so you can style or overlay it for confirmation.
Note: It will track exactly on top of Δ %, so if you need a distinct signal consider replacing it with a “raw” B/S ratio or a different transform.
Z-Score (yellow):
Standardizes the bar’s raw Δ (
B
−
S
B−S) versus its recent mean/σ over Z Window.
Caps at ±Z Cap Threshold, then scales back to ±1.
Highlights bars that are unusually imbalanced compared to recent history.
Bar-coloring marks extreme |Z| > 1 in solid yellow.
Cumulative Δ (teal):
A running sum of bar-by-bar Δ, normalized to its peak absolute over Cum Δ Lookback.
Tracks whether buying or selling has been dominant over the last N bars.
Values above zero show net buying accumulation; values below, net selling.
Putting It All Together
Trend Entry/Exit
A sustained positive Cum Δ plus repeated high-Z bars confirms institutional buying.
Conversely, negative Cum Δ with extreme Z down-bars signals strong selling.
Divergence
When price makes new highs but Δ % or Cum Δ fails to follow, suspect weakening momentum.
A Z-Score peak without corresponding price movement often precedes reversals.
Micro-structure
Single-bar Flow Bars show quick supply/demand switches.
Use the opacity controls to “ghost” the losing side behind the winner—ideal for scalping or order-flow analysis.
Pro Tips
Align Look-back Windows with your chart timeframe (e.g. 20–50 bars on a 1 min chart).
Combine with price support/resistance zones: an extreme Z-Score at a pivot often marks a high-probability turn.
Customize the Ratio plot to raw buy/sell ratio if you need a different sensitivity curve.
Use this tool as a real-time “flow compass”—it blends volume, imbalance, and statistical context into one clean pane, helping you spot when buying or selling truly takes over.
A multi‐metric lower‐pane indicator that condenses volume imbalances and flow dynamics into four normalized measures—Δ %, Ratio, Z-Score, and Cumulative Δ—plus optional buy/sell “flow” bars. All series are scaled to –1…+1 for direct comparison.
How to Add & Configure
Add the script to your chart (overlay = false).
In Settings → Inputs, toggle on/off the four metrics and the background flow bars.
Adjust look-back windows:
Flow Lookback controls how much history the bars normalize over.
Z Window sets the period for the Z-Score’s mean/standard deviation.
Cum Δ Lookback determines how reactive the cumulative Δ line is.
Choose colors, line widths, and opacity to match your style.
Reading the Metrics
Flow Bars (teal/green & red overlay):
Plotted as vertical columns from –1…+1, they show buy vs. sell pressure each bar.
The taller bar is drawn behind, the shorter in front—so you always see both sides of the fight.
Use: Quickly spot bars where one side dominates (e.g. an all-green or all-red bar).
Δ % (orange line, thick):
(
B
u
y
s
−
S
e
l
l
s
)
/
(
B
u
y
s
+
S
e
l
l
s
)
(Buys−Sells)/(Buys+Sells).
Measures net imbalance as a percentage of total flow.
Crosses of 0 indicate a shift from selling to buying pressure (or vice versa).
Values near ±1 reveal nearly pure one-sided flow.
Ratio (purple dashed):
Defined as
(
B
/
S
−
1
)
/
(
B
/
S
+
1
)
(B/S−1)/(B/S+1), which algebraically equals Δ %.
Plotted separately so you can style or overlay it for confirmation.
Note: It will track exactly on top of Δ %, so if you need a distinct signal consider replacing it with a “raw” B/S ratio or a different transform.
Z-Score (yellow):
Standardizes the bar’s raw Δ (
B
−
S
B−S) versus its recent mean/σ over Z Window.
Caps at ±Z Cap Threshold, then scales back to ±1.
Highlights bars that are unusually imbalanced compared to recent history.
Bar-coloring marks extreme |Z| > 1 in solid yellow.
Cumulative Δ (teal):
A running sum of bar-by-bar Δ, normalized to its peak absolute over Cum Δ Lookback.
Tracks whether buying or selling has been dominant over the last N bars.
Values above zero show net buying accumulation; values below, net selling.
Putting It All Together
Trend Entry/Exit
A sustained positive Cum Δ plus repeated high-Z bars confirms institutional buying.
Conversely, negative Cum Δ with extreme Z down-bars signals strong selling.
Divergence
When price makes new highs but Δ % or Cum Δ fails to follow, suspect weakening momentum.
A Z-Score peak without corresponding price movement often precedes reversals.
Micro-structure
Single-bar Flow Bars show quick supply/demand switches.
Use the opacity controls to “ghost” the losing side behind the winner—ideal for scalping or order-flow analysis.
Pro Tips
Align Look-back Windows with your chart timeframe (e.g. 20–50 bars on a 1 min chart).
Combine with price support/resistance zones: an extreme Z-Score at a pivot often marks a high-probability turn.
Customize the Ratio plot to raw buy/sell ratio if you need a different sensitivity curve.
Use this tool as a real-time “flow compass”—it blends volume, imbalance, and statistical context into one clean pane, helping you spot when buying or selling truly takes over.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.