Indicator comparison

VWAP vs VWMA: the reset changes the indicator

VWAP and VWMA both weight price by volume. VWAP accumulates from an anchor, while VWMA rolls through a fixed number of bars.

Direct answer

Use VWAP to measure volume-weighted price from a session or event anchor. Use VWMA when you need a rolling volume-weighted moving average, such as the latest 20 bars. A VWMA length drops older bars as new ones arrive. VWAP keeps all bars since its last reset.

What to set before testing

VWAP memory

All bars since the anchor

VWMA memory

A rolling N-bar window

Clean comparison

SPY, 5-minute bars

First VWMA length

20 bars as a test input

VWAP and VWMA compared

Both indicators use volume, but their windows behave differently as the chart advances.

FeatureVWAPVWMA
WindowCumulative from an anchor or resetRolling fixed number of bars
Old dataRemains until the next resetDrops out when it leaves the lookback window
Common useSession value, execution context, event anchorRolling trend and volume-weighted momentum
Main parameterAnchor period and sourceLength and source
Failure modeLate-session lag or a poorly chosen anchorLength chosen to fit past swings

A test workflow you can audit

  1. 1

    Set one chart and session

    Use SPY 5-minute bars during regular trading hours. Keep extended-hours data either on or off for both indicators.

  2. 2

    Define the two windows

    Use Session VWAP and a 20-bar VWMA. Record that 20 bars equals 100 chart minutes on a 5-minute chart.

  3. 3

    Apply one shared signal

    For example, test a closed-bar price cross with the same stop, exit, commission, and slippage for each indicator.

  4. 4

    Test later dates

    Do not select the VWMA length on the full history. Reserve at least 20 later sessions for a separate check.

Notes from the chart review

These checks keep the rule separate from the story told after a move has already happened.

When I compare VWAP and VWMA on SPY, I label the rolling window in minutes as well as bars. A 20-bar length means something different on every chart interval.

When I review QQQ late in the session, I expect session VWAP to remember the morning. I do not call that a bug; it is how the cumulative window works.

When I test AAPL, I change the indicator and keep the entry logic fixed. If I change both, I cannot attribute the result to VWAP or VWMA.

Compare both indicators in one script

A single Pine Script strategy can switch between Session VWAP and VWMA while keeping the trade rule and costs identical.

Create a Pine Script v6 strategy for SPY on 5-minute bars with a selector for Session VWAP or a 20-bar VWMA. Enter on a closed-bar cross above the selected line, use the same ATR stop and session-close exit for both modes, and include commission and slippage inputs. Plot both lines but trade only the selected mode.
Turn the rule into inspectable Pine Script

How the calculations differ

VWAP divides cumulative price-volume by cumulative volume from its anchor. VWMA performs a similar weighted average across a rolling lookback, such as the latest 20 bars.

Because the window changes, VWMA can react faster after old high-volume bars leave the lookback. Session VWAP keeps those bars until the next session reset.

Match the indicator to the question

VWAP fits questions about location relative to a session or event. VWMA fits questions about the recent rolling trend with volume weighting.

  • Use VWAP when the open, week, month, or event defines the sample.
  • Use VWMA when a stable N-bar lookback defines the sample.
  • Use both only if each one changes a written decision rule.

Why crossings disagree

A recent burst of volume can move a short VWMA quickly. The same burst may have less effect on session VWAP late in the day because the denominator already includes hours of volume.

That disagreement is expected. It shows that the indicators are measuring different windows, not that one line is automatically more accurate.

Sources

Frequently asked questions

This page is an educational information tool, not investment advice or a recommendation to trade. Examples are test definitions, not live signals, historical results, or promises of returns. VWAP is based on past price and volume, and actual fills can differ from chart prices. Check current market data, costs, product rules, and your own risk limits before trading.

Put the VWAP rule in writing

Pineify turns a plain-language setup into Pine Script you can read, edit, and test. The script does not predict the next price.

Build a VWAP test rule