OPEN-SOURCE SCRIPT
Mis à jour

Volume Profile Composite, Naked POC & Value-Area

4 966
Volume Profile — Composite, Naked POC & Value-Area
==================================================

WHAT IT IS

A volume-at-price profile built for depth and decisions. It measures where trade
actually concentrated across the loaded history, distils that distribution into
the levels traders use — Point of Control (POC), Value Area (VAH/VAL), High and
Low Volume Nodes (HVN/LVN), and untested "naked" prior-session POCs — and then
converts those levels into a plain-language read of where price sits in the
auction (premium, discount, or inside value; balancing or migrating).

It is a study for chart analysis and education. It plots levels and context; it
does not place orders and does not output buy/sell signals.


HOW IT WORKS (ENGINE)

Volume is accumulated bar by bar into a price-keyed map on a fine grid (the
symbol's minimum tick multiplied by a user factor), then re-aggregated to the
chosen number of display rows. Because the engine uses a map rather than a fixed
lookback array, the profile can span every loaded bar instead of only a recent
window, and it is not limited by the historical bar-reference ceiling.

Each bar's volume is distributed across that bar's high-low range over a capped
number of samples, and tagged buy or sell by bar direction, producing a two-tone
histogram and a per-level delta. Where intrabar (lower-timeframe) data is
available, recent history can optionally be refined from it; older bars fall back
to the bar-range method. The Value Area is grown outward from the POC bin until
the chosen percentage of total volume is captured. Prior-day, prior-week and
full-history composite levels reuse the same value-area routine on their own maps.
The heavy redraw runs on bar open/close rather than on every realtime tick, to
keep live charts responsive.


WHY THESE COMPONENTS ARE COMBINED (MASHUP JUSTIFICATION)

This is one volume-profile engine, not a stack of independent indicators. Every
layer is computed FROM THE SAME accumulated volume map, and each one exists to
remove a specific blind spot of the raw histogram. A bare histogram only answers
"where did volume happen"; it cannot tell you whether price is rich or cheap,
which level matters next, or whether the market is balancing or trending. The
combined layers answer those questions, and they work together as follows:

- POC and Value Area transform the raw distribution into a fair-value frame, so
every other reading can be expressed as premium, discount, or inside value.

- HVN and LVN classify each price level produced by that same distribution as
acceptance (a volume shelf where reactions are more likely) or a thin gap
(where price tends to move quickly). This tells you how a level is likely to
behave, which the POC/Value Area alone do not.

- Naked prior-session POCs carry acceptance forward in time: they are POCs from
earlier sessions that price has not yet traded back through, derived from the
same per-session maps, and they act as revisit references.

- Value migration is simply the sequence of those session POCs read as a
direction, turning the profile history into a balancing-versus-trending read.

- The composite overlay keeps the full-history POC and Value Area in view while
you work a shorter, more legible recent window, so context is never lost.

- VWAP, Initial Balance, an expected-move band, and cumulative-volume-delta
divergence are confluence layers. They are optional and each degrades
gracefully if its data is absent. They are included because volume-profile
levels are used in context: VWAP gives the session's volume-weighted mean,
Initial Balance gives the opening reference, the expected-move band frames a
realistic day's range, and CVD-versus-price flags exhaustion. Each one answers
"does independent volume/price information agree with what the profile shows
here?", which is exactly how these levels are traded in practice.

- The Auto-Read is the synthesis step: it does not add new data, it ranks the
levels the engine already produced by distance to price and states the auction
context in words.

In short, the histogram is the raw material and every other element is a
transformation of that same data into a level, a classification, a confluence
check, or a written read. That shared derivation is the reason they belong in a
single script rather than as separate indicators.


WHAT IT PLOTS

- Buy/sell two-tone histogram, drawn in the clear space to the right of price so
candles stay visible.
- POC, Value Area (VAH/VAL, adjustable percentage), HVN/LVN nodes.
- Naked daily POCs, with a creation-time check that skips levels already traded
through and an optional age-out so the list stays meaningful.
- Polarity flip: a prior-day Value Area edge that price closes decisively beyond
and holds changes role (broken VAH becomes support; broken VAL becomes
resistance) and feeds the support/resistance read.
- Prior-day and prior-week POC/Value Area, full-history composite overlay,
developing POC.
- VWAP with standard-deviation bands, Initial Balance, expected-move band,
cumulative-volume-delta divergence, buy/sell imbalance shelves, poor highs/lows,
single-print gaps.
- Higher-timeframe POC bias (a light proxy — see Limitations).
- Auto-Read dashboard (full or compact), one-line headline, and an on-chart
identity strip showing the script name, symbol and timeframe.


HOW TO USE

1. Choose a scope: Rolling (default), Composite (all history), From date, or
Fixed range. The composite overlay keeps the big-picture levels visible.
2. Read location first from the headline or dashboard: inside value, premium, or
discount, and whether value is migrating up, down, or flat.
3. Treat the levels as a map, not a signal. POC acts as a mean-revert magnet;
Value Area edges are balance boundaries; HVN suggests stalls; LVN suggests
fast moves; a naked POC is a revisit reference.
4. Look for confluence with VWAP, Initial Balance, and prior-session levels, and
treat CVD divergence as a caution flag.
5. Detail presets (Simple / Standard / Pro) gate how much is shown. A compact
dashboard toggle trims the table to the key decision fields.


WHAT MAKES IT ORIGINAL

- Full-history depth via the price-keyed map, beyond a fixed lookback window.
- A built-in, past-only calibration of the profile's own claims: it logs
value-edge and POC-stretch reversion events against the prior-day Value Area
(which exists on every bar, so the measurement backfills over history), waits a
fixed horizon, and reports the realised hit-rate with a 95% confidence
interval. This is descriptive of past behaviour on the specific instrument; it
is explicitly not a backtest and not a forecast.
- A decision-ordered, plain-language Auto-Read derived entirely from the engine's
own levels.


DATA SOURCE AND ANY-MARKET USE

The volume source is user-selectable (Settings > Data source), so the profile can
be built from the symbol's own volume or from any other series your feed
provides. For symbols that report no native volume (some cash indices and FX
feeds), an optional "borrow volume" field lets you supply a volume-bearing proxy
for the same instrument; it only activates when the charted symbol genuinely has
no volume. The volatility-index symbol for the expected-move band is also
user-set and falls back to a daily-ATR band when left blank. An optional
asset-class auto-tune adapts the grid and node percentiles to the detected class.
All of these are blank or off by default, so nothing is tied to one market.


CALIBRATION NOTE

The calibration panel is descriptive only. It reports how often, in the past, on
the current symbol, price followed through after the logged events. Small samples
are flagged. It is not a probability of future results.


LIMITATIONS (HONEST)

- This uses a BAR-RANGE volume distribution (optionally refined by lower-timeframe
bars). It approximates where volume traded within each bar. It is NOT exchange
price-by-price volume, tick data, or order-flow/footprint, and it cannot see
bid/ask.
- It needs real volume. Cash indices often report none — use the matching future
or continuous contract, or the borrow-volume field.
- The higher-timeframe POC is a light single-bar proxy (the price of the
highest-volume higher-timeframe bar over a lookback), not a full higher-
timeframe profile.
- All readings are probabilistic context, not predictions.


DISCLAIMER

This script is a study/indicator for chart analysis and education only. It is NOT
a strategy, NOT a recommendation, and NOT financial advice. It places no orders
and guarantees no result. Trading involves substantial risk; a level's past
behaviour does not assure future behaviour. Do your own research and manage your
own risk.
Notes de version
v2.0 — Adaptive VWAP anchoring + refreshed visuals
The VWAP now auto-anchors. Anchor mode is Session / Swing Low / Swing High / Dual (auto), defaulting to Dual — it anchors to the most recent confirmed swing and re-bases as new structure forms. The old manual "Anchored VWAP start" date has been removed; there's no date to set any more. A new "Swing pivot length" input controls how significant a swing must be (default 21).
VWAP visuals reworked: a trend-coloured line (teal when rising, magenta when falling) wrapped in a soft glow, with matching sigma bands and a new "VWAP line glow" toggle.
Refreshed colour scheme across the core identity — bull/support teal, bear/resistance magenta, POC orange, value-area blue, and a darker dashboard. Specialty layers (HVN, naked POC, prior-day/week, Initial Balance, expected-move, poor highs/lows, HTF POC) keep their own distinct hues so the chart stays legible.
The profile engine, all levels, the Auto-Read and the calibration tracker are unchanged — this update only touches the VWAP layer and the palette.
Note: a swing anchor confirms one pivot-length after the swing, since TradingView's VWAP resets at the confirmation bar and can't be seeded back to the pivot. It re-anchors correctly, just with that delay.
Study/indicator for education only — not financial advice.
Notes de version
Volume Profile — Composite, Naked POC & Value-Area

Update write-up

A major update to the order-flow and measurement layers, with refreshed visuals. Everything new is built on the same accumulated volume map — no separate indicators bolted on.


Probabilistic buy/sell split (Bulk Volume Classification): the two-tone, CVD, imbalance and delta panel now use a continuous buy share Φ(ΔP / σΔP) instead of a binary up/down flag. Optional VPIN order-imbalance "toxicity" row.
Calibration reports a real EDGE: Hit, Base and Edge (hit-rate minus base rate), three event classes (VA reversion, POC-stretch reversion, VA-breakout continuation), a regime-conditioned footer, and first-touch (triple-barrier) labelling.
Profile reads: real skew / kurtosis / bimodality shape, optional Gaussian (KDE) smoothing before node detection, optional RTH session restriction, and a repaint-fixed (confirmed-bar) HTF POC.
Visuals: new Blue/Orange scheme (Teal/Magenta alternative), green support / red resistance, yellow POC, right-anchored profile, proportional delta bars; dashboard and calibration tables auto-adapt to dark/light backgrounds.
Defaults tuned for NSE NIFTY index futures (intraday) — change the Volume source and Session for any other market.


Calibration is descriptive of past behaviour only — read the EDGE column, never the hit-rate alone, and never tune to make it green.


DESCRIPTION (only if you also update the main field)

What it is — A full-depth volume-at-price engine. It reads where trade happened across all loaded history, distils it into the levels traders act on — POC, Value Area, High/Low-Volume Nodes and untested ("naked") POCs — and states a plain-language read of where price sits in the auction. Runs on any volume-bearing symbol in any market; the volume source and every optional feed are user-selectable. Defaults suit NSE NIFTY index futures (intraday).

Why these parts are combined (mashup rationale) — A raw histogram only answers "where did volume happen". It cannot say whether price is rich or cheap, which level matters next, or whether the auction is balancing or trending. This is ONE engine whose layers each remove a blind spot of the raw histogram, all derived from the SAME volume map: Value Area + POC → fair-value frame; HVN/LVN → acceptance vs gap; naked POCs → cross-session magnets; value migration → trend; composite overlay → long-term context; buy/sell split, CVD, VPIN → order flow on the same volume; VWAP / IB / expected-move → confluence; Auto-Read → ranks the engine's own levels and states the read; Calibration → measures, on past data only, whether those reads had an edge on this symbol. The histogram is the raw material; every other layer is a transformation of it — that is why they live in one script.

How to use — Pick a scope (Rolling / Composite / From date / Fixed range); read location first (in value / premium / discount, and whether value is migrating); use levels as a map not a signal (POC = magnet, VA edges = boundaries, HVN = stalls, LVN = fast moves, naked POC = revisit magnet); seek confluence with VWAP / IB / prior-session levels; treat CVD divergence and high VPIN as caution flags.

Concept credit (techniques, not code) — Market Profile / value-area framing: Steidlmayer and Dalton. Bulk Volume Classification and VPIN: Easley, López de Prado & O'Hara. Triple-barrier labelling: López de Prado. Wilson score interval; Wilder's ADX and a Kaufman-style efficiency ratio for the regime read. The full-history price-keyed map, the EDGE calibration and the Auto-Read are this script's own implementation.

Limitations & disclaimer — Uses a bar-range volume distribution; it is not exchange price-by-price volume, tick data or order flow, and cannot see bid/ask. The buy/sell split is a probabilistic estimate from bar data. All reads are probabilistic context, not predictions; calibration is past-only. Study / education only — not a strategy, not a recommendation, not financial advice. Markets involve risk; do your own research.
Notes de version
What's new in this update:

Unified luma-adaptive theme across the dashboard, legend key and calibration panel — auto-reads the chart background and flips dark/light so every table stays readable on any theme; institution-style zebra-striped dashboard.
Bold glow level lines + colour-coded legend key that decodes every line on the chart; configurable line thickness and legend text size.
Exports bus (POC / VAH / VAL / regime / developing POC / VWAP / VPIN) so this can feed other scripts via request.security().
Full decision dashboard, prior day/week, Initial Balance, naked POC, CVD, VPIN, regime and HTF on by default.

How to use: read location first (in value / premium / discount and whether value is migrating up/down/flat), then use levels as a map — POC = mean-revert magnet, VA edges = balance boundaries, HVN = expect stalls, LVN = expect fast moves, naked POC = revisit magnet. Seek confluence with VWAP / IB / prior-session levels; treat CVD divergence and high VPIN as caution flags. In the calibration panel read the EDGE column (hit-rate minus base rate), never the hit-rate alone.
Universal: the Volume source input lets it run on any volume-bearing symbol in any market; defaults are tuned for NSE NIFTY index futures (intraday) — change the source and session for other instruments.
Honesty: bar-range volume distribution (not exchange tick/footprint); the buy/sell split is a probabilistic estimate; calibration is descriptive of past behaviour only, not a backtest or prediction.
Study / education only — not financial advice.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.