volume
VWAP + Standard Deviation Bands
The institutional benchmark price, with volume-weighted standard-deviation bands around it. A level, not a signal.
What is it?
Volume Weighted Average Price is the price benchmark institutional desks measure themselves against. A fund executing a large order judges its fills as "at or better than VWAP" — it is the reference for fair execution across the trading day. Adding volume-weighted standard-deviation bands turns that single reference into a band: ±2 standard deviations historically contains the large majority of trading around the VWAP, so the edges mark statistically stretched zones.
The key institutional framing is that VWAP is a level, not a signal. It tells you where the volume-weighted average transaction has occurred, which is information about value and positioning — not a prediction of the next move. Price holding above VWAP suggests buyers are in control relative to the session's average; price snapping back from the +2 band on a volume climax is a common mean-reversion context. Neither is a guarantee.
This is the rolling-N variant (default 20 bars) so it is usable on any backtest window rather than only resetting each session.
Formula
VWAP = Σ(TP·vol)/Σ(vol), TP=(H+L+C)/3; STDEV = √(Σ(vol·(TP−VWAP)²)/Σ(vol)); Upper/Lower = VWAP ± num_dev·STDEV
How it's calculated
For each of the last N bars, take the typical price TP = (high + low + close) / 3 and the bar's volume. VWAP is the volume-weighted mean of TP: Σ(TP·volume) / Σ(volume).
The band width uses the volume-weighted variance around that VWAP: Σ(volume·(TP − VWAP)²) / Σ(volume), then the standard deviation is its square root. The upper and lower bands are VWAP ± num_dev × STDEV (num_dev defaults to 2).
A useful sanity check: when price is perfectly constant, the standard deviation is zero and both bands collapse onto the VWAP line.
When to use it
**As a value reference.** Compare current price to VWAP to gauge whether the market is trading above or below its volume-weighted average — useful as a bias filter rather than an entry trigger.
**As mean-reversion context.** A touch of the +2 or −2 band, especially on a volume spike, marks a stretched condition where reversion toward VWAP becomes more likely. "More likely" is not "certain" — strong trends ride a band for extended periods.
**As trend context.** Price consistently holding outside a band can indicate trend continuation, not exhaustion. The bands describe dispersion; direction comes from elsewhere.
Common parameters
period = 20
Rolling lookback in bars. Shorter reacts faster; longer is a more stable benchmark.
num_dev = 2
Band width in standard deviations. ~2 captures most price action; 1 is tighter, 3 wider.
Pitfalls
**Honest limitations — read before relying on it.** VWAP bands are an analysis tool, not a profit guarantee. They improve the *probability* and *context* of a read; they do not provide certainty. Institutional desks use VWAP every day and still take losing trades.
**It is a level, not a signal.** A band touch is not an order to trade. It must be combined with your own thesis, confirmation, and — non-negotiably — risk management (position sizing and stops).
**Bands do not predict direction.** They describe how far price has stretched from its volume-weighted mean, nothing more. In a strong trend the "stretched" band edge keeps moving and reversion never comes.
**Rolling vs session.** This rolling-N implementation differs from a session-anchored VWAP; values will not match a desk's intraday session VWAP exactly. Pick the variant that matches how you actually trade.
Pairs well with
VWAPRVOLCVDVolume Profile
Ready to test a strategy using VWAP + Standard Deviation Bands?
Build a strategy →