Systemicalpha

Volume Weighted Average Price

systemic:core-vwapIndicatorsfunction1 cr

Inputs

NameTypeDescription
WindowintegerThe number of periods over which to calculate the rolling VWAP.
PricefloatarrayThe price series for VWAP calculation. Typically closing prices, though any consistent price type works.
VolumefloatarrayThe trading volume corresponding to each price period. Volume is the core differentiator that makes VWAP meaningful—it weights prices by actual market activity.

Outputs

NameTypeDescription
VWAPfloatarrayThe Volume Weighted Average Price for each period in your data series.

VWAP calculates the average price at which an asset has traded over a rolling window of N bars, weighted by volume — not the traditional session-reset VWAP. It continuously updates bar-by-bar, the same way an SMA does.

VWAP=∑i=1N(Pricei×Volumei)∑i=1NVolumeiVWAP = \frac{\sum_{i=1}^{N} (Price_i \times Volume_i)}{\sum_{i=1}^{N} Volume_i}

How It Works

flowchart TD
    subgraph Data["Market Data (last N bars)"]
        P["Price (typical: H+L+C/3)"]
        V["Volume"]
    end
    
    subgraph Calc["Rolling Window Calculation"]
        PV["Price × Volume"]
        SUM1["Σ(Price × Volume), last N bars"]
        SUM2["Σ Volume, last N bars"]
    end
    
    subgraph Result["Output"]
        DIV["SUM1 ÷ SUM2"]
        VWAP["VWAP"]
    end
    
    P & V --> PV --> SUM1 --> DIV
    V --> SUM2 --> DIV
    DIV --> VWAP

Missing Data

A bar is used only when both Price and Volume are present at that slot; a bar missing either one is dropped from the window — never treated as zero. "N bars" means N observed (non-gap) bars, so the window skips past gaps (e.g. a weekend) to the next real trading days.

SituationOutput
Fewer than N observed bars so far (warm-up)No value yet
A missing Price or Volume slotNo value at that slot
A real bar with zero volume (no trades)Counted as an observed bar — a window of all-zero-volume bars yields no value (nothing traded, not "0")

Interpreting VWAP

Price PositionInterpretation
Price > VWAPBuyers paying above average — bullish pressure
Price < VWAPBuyers paying below average — bearish pressure
Price ≈ VWAPFair value zone
flowchart LR
    subgraph Zones["Price vs VWAP"]
        ABOVE["Above VWAP<br/>Bullish bias"]
        AT["At VWAP<br/>Fair value"]
        BELOW["Below VWAP<br/>Bearish bias"]
    end
    
    ABOVE --> AT --> BELOW

Institutional Usage

VWAP serves as a benchmark for trade execution quality:

Trader TypeVWAP Use
BuyerAim to buy below VWAP (good fill)
SellerAim to sell above VWAP (good fill)
AlgorithmExecute orders near VWAP to minimize market impact

Trading Strategies

1. VWAP as Support/Resistance

ConditionAction
Price pulls back to VWAP in uptrendPotential buy zone
Price rallies to VWAP in downtrendPotential sell zone

2. VWAP Crossover

EventSignal
Price crosses above VWAPIntraday bullish
Price crosses below VWAPIntraday bearish

3. VWAP Bands

Standard deviation bands around VWAP help identify:

  • Overbought: Price at +2σ band
  • Oversold: Price at -2σ band

VWAP vs Moving Averages

AspectVWAP (this module)SMA/EMA
Volume✓ Incorporated✗ Price only
WindowRolling, last N barsRolling, last N bars
Institutional usePrimary benchmarkSecondary indicator
Best forExecution assessmentTrend identification

Considerations

FactorImpact
Window sizeLarger N smooths more but reacts slower to recent volume shifts
Volume spikesHigh-volume bars heavily influence VWAP
Rolling, not session-anchoredUnlike a broker's intraday VWAP, this indicator never resets — pick N to match the lookback you care about

Advantages

  • Volume-weighted — Reflects true average traded price
  • Institutional benchmark — Standard for execution quality
  • Dynamic support/resistance — Continuously updates with new bars
  • Clear signal — Above/below provides directional bias

Disadvantages

  • Not session-anchored — Does not replicate a broker's daily-reset VWAP; use window sizing to approximate a session
  • Volume dependent — Requires reliable volume data
  • Warm-up gap — No value until N bars have been observed

Further Reading


Indicator Assessment

%%{init: {'theme': 'base', 'themeVariables': { 'cScale0': '#2563eb', 'cScale1': '#7c3aed'}}}%%
quadrantChart
    title VWAP Indicator Assessment
    x-axis Low Complexity --> High Complexity
    y-axis Low Reliability --> High Reliability
    quadrant-1 High Value
    quadrant-2 Specialized
    quadrant-3 Limited Use
    quadrant-4 Accessible
    Stocks: [0.30, 0.80]
    Crypto: [0.30, 0.60]
DimensionStocksCryptoNotes
Popularity9/107/10The institutional standard for execution quality in equities; increasingly adopted in crypto
Reliability8/106/10Highly reliable for liquid stocks with accurate volume data; crypto volume reporting varies
Complexity3/103/10Simple rolling-window formula; straightforward interpretation
Versatility7/106/10Excellent for intraday trading; window size tunes the effective lookback
Recent Interest8/108/10Core institutional tool; growing use in algorithmic and crypto trading strategies
Rendering diagrams...
© 2026 WanoLabs. All rights reservedAlpha build v0.1.5