OPEN-SOURCE SCRIPT
Aggiornato

Supply & Demand Zones (Volume-Based)

6 364
📌 Supply & Demand Zones (Volume-Based) — Indicator Description

Overview

This indicator visually highlights potential supply and demand price zones using historical candle structure combined with relative volume behavior.The zones are intended to help users observe areas of increased market activity where price has previously reacted. This tool is designed for visual analysis only.

How the Zones Are Identified

Demand zones are highlighted when price shows a strong bullish reaction following a bearish candle.Supply zones are highlighted when price shows a strong bearish reaction following a bullish candle.Relative volume is used as context, not as a predictive input, to classify zones into higher or lower activity levels.Zones automatically invalidate when price structurally breaks them.

About the Percentage Display

The percentage shown on a zone represents normalized relative volume strength at the time the zone was formed.This value is not a probability, not a success rate, and not a performance metric.It should not be interpreted as a prediction or trading signal.Percentages are displayed only for active zones and are removed once a zone is invalidated.

How This Indicator Is Intended to Be Used

As a visual reference tool for identifying historical supply and demand areas.As a contextual overlay alongside other forms of technical analysis.To observe how price behaves when revisiting previously active zones.This indicator does not suggest trade direction, entry timing, or exit levels.

Important Notes & Limitations

All zones are derived from historical price and volume data.Market conditions change, and historical zones may lose relevance over time.No trading decisions should be made based solely on this indicator.Users are encouraged to apply their own analysis and risk management.

Disclaimer

This indicator is provided for educational and informational purposes only.It does not constitute trading, investment, or financial advice.The author assumes no responsibility for decisions made using this tool.
Note di rilascio
Major upgrade — the supply/demand idea kept, every soft part made adaptive, participation-aware and calibrated

The core behaviour is unchanged: an impulse candle leaves a zone, relative volume tiers it, the zone extends right and is removed when price breaks it. What this version replaces is everything that used to be a fixed assumption or an unverified number.

What changed

1 · Self-calibrating displacement (no fixed body multiple).

The impulse trigger no longer uses a hard "current body ≥ 2× the previous body." Each candle's body is now ranked against the recent body distribution (a rolling percentile, with an ATR floor so a quiet window can't manufacture zones). An impulse qualifies when it sits at or above the percentile gate, or when it fully engulfs the prior candle. The practical effect: detection adapts to the instrument and timeframe automatically — the same settings behave sensibly on a 1-minute index future and a daily equity, instead of being tuned to exactly one chart.

2 · Trade-side (delta) grading via Bulk Volume Classification.

Raw volume can't distinguish a demand zone built on genuine buying from one built on distribution. The impulse's volume is now signed by estimating its trade-side from the standardized return (Bulk Volume Classification — no lower-timeframe request, so it works on any symbol). When the impulse delta opposes the zone direction (high volume, but the wrong side), the zone is downgraded a tier or rejected outright — your choice in settings. This removes a whole class of high-volume-but-meaningless zones the original couldn't see.

3 · A real zone lifecycle.

Close-based invalidation. A single wick poke no longer kills a valid zone; invalidation requires a close through it (with an optional ATR buffer).
Mitigation fade. Each zone tracks how deeply price has penetrated it and fades accordingly, so a half-eaten zone visibly looks weaker than an untouched one.
Merge. Overlapping same-side zones combine into a single stronger zone instead of stacking near-duplicates, keeping the chart clean.

4 · The strength number is now measured, not assumed.

This is the headline change. The old percentage was a relabeled volume ratio dressed as a percent. It's replaced by the zone tier's realised forward respect-rate: every time price returns to a zone, the reaction is scored forward over a fixed horizon (respected vs broken) and tallied per volume tier, reported with a Wilson confidence interval and an edge over the unconditional base rate. If a higher-volume tier doesn't actually hold better on your symbol, the dashboard now shows that plainly — the tool can disprove its own tiers, which is the opposite of a vanity score.

5 · Visuals and usability.

Cleaner, more solid zone fills (this version increases fill intensity ~50% over the first cut), with an optional glow halo that is off by default.
Zone labels now use a contrast text colour on a solid band-coloured chip, so the legend stays readable against the fill on any theme.
Adaptive Auto theme that reads chart-background luminance, so the panel and zones stay legible on light or dark charts.
A Compact-default dashboard (status + per-tier respect-rate) with a full Pro table (Hit% ± Wilson, Base%, Edge, MFE/MAE).

6 · Works on any market.

New Data Source inputs (Open / High / Low / Close / Volume) drive detection, the bands and the calibration, so the script runs on any instrument or candle type (including Heikin-Ashi). Defaults are tuned for NIFTY index-futures intraday, including the 09:15–15:15 session — change the source, session or lengths for other assets. Data-window EXP_* series (nearest demand/supply bounds, live delta, top-tier hit/edge) are exported for use in other scripts.
Why these components belong in one script
They are not separate indicators bolted together — each covers a blind spot of the others, forming one decision. Displacement decides where a zone forms; trade-side decides whether to believe the volume that formed it; the lifecycle decides whether the zone is still alive and how fresh it is; and calibration decides whether zones of that strength have actually held on this market. Remove any one layer and the zone map loses a check it can't recover — which is why they ship together.

How to use

Zones are descriptive context, not signals. A fresh, high-tier zone with confirming delta is the strongest read. Use the dashboard's per-tier respect-rate and its edge over the base rate to judge whether a tier is worth trusting on the instrument you're trading — if the top tier doesn't beat the base rate, higher volume isn't helping there. Zones fade as they're mitigated and disappear on a close through them; the label shows the tier's realised respect-rate once it has enough samples (the live volume ratio before that).

Originality

Most volume-zone scripts draw a box, attach a heuristic "strength %," and never check whether that number means anything. The contribution here is the closed, honest loop — adaptive detection, participation-aware tiering, a proper lifecycle, and a built-in respect-rate harness that turns the strength figure into a measured, Wilson-bounded, falsifiable statistic.

Credits

Bulk Volume Classification (trade-side from standardized returns) — Easley, López de Prado & O'Hara. Wilson score confidence interval — Edwin B. Wilson. Percentile/rank-based self-calibration — robust-statistics practice. Supply/demand and order-block zoning — classical auction-market / smart-money lineage. The displacement-adaptive detection, the delta-graded tiering and the forward respect-rate harness are the author's original implementation.

Honest limitations & disclaimer

The respect-rate is in-sample and forward-measured at a fixed horizon, with no costs, slippage or stops — a study aid, not a backtest. BVC is an estimate of trade-side from price and volume, not true tick data (but it's the most honest delta Pine allows without a lower-timeframe request). Zones invalidate when price breaks them and may not persist as conditions change; past behaviour does not assure future behaviour. Educational / informational only — not financial advice, not a signal, not a recommendation. Manage your own risk and paper-trade before risking real money.
Note di rilascio
What's new in this update

This release rebuilds the engine around one principle: the strength number on a zone should be measured, not asserted. Every grade is now forward-tested against what price actually did when it returned.

Detection is sharper and self-calibrating

Impulse trigger ranks the body against its recent percentile distribution (no fixed multiple) and now requires a close-in-extreme to reject big-but-wicky bars.
Zones anchor to their active edge with a crisp edge line at the exact support/resistance level, and a Max Zone Height (× ATR) cap keeps levels as tight bands instead of wide walls. New Zone Style selector: Zone + Edge, Edge line only, or Zone only. Glow defaults off for sharp edges.

Smarter grading

Square-root participation grade — a move that outruns its volume (vacuum) is downgraded; one backed by volume (ignition) can upgrade.
Trade-side delta signs the volume (standardized-return method), and decisive one-sided flow can now upgrade a tier, not just downgrade a wrong-side one.
Regime filter (efficiency ratio) buckets outcomes trend-vs-chop and downgrades/rejects counter-trend zones.
Liquidity-sweep origin tagging (SW) with optional tier boost.

Real lifecycle

Mitigation fade, overlap merge, close-based invalidation, and polarity flip — a broken zone flips once into an opposite-side breaker (BRK) instead of vanishing.

Honest calibration

Each re-touch is resolved by a triple-barrier (profit / stop / horizon), entered at the proximal edge, uniqueness-weighted and recency-decayed so overlapping or stale touches can't inflate the rate, and reported as an edge over a regime-matched base rate with a multiple-testing-corrected significance flag and a Wilson interval.

Institution-grade dashboard

Adaptive to chart background. Key-read row (Bias, Regime, flow), nearest-zone read-out (side · tier · realised hit-rate · distance in R · freshness), per-tier Hit%/Base%/Edge/MFE/MAE, a Trend/Chop split, and a legend.

Generic exports for cross-script use

EXP_DemandTop/Bot, EXP_SupplyTop/Bot, EXP_Delta, EXP_T3Hit, EXP_T3Edge, EXP_ZoneDist, EXP_InZone, EXP_NearTier, EXP_NearHit, EXP_NearFresh, EXP_ZoneBias, EXP_ZoneTouch, EXP_ZoneBreak, EXP_Breaker — all in the Data Window.

Defaults tuned for NIFTY index futures, intraday, NSE session; all sources configurable for any market.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.