# Volume Weighted Moving Average (VWMA): Formula and How to Use

URL: https://emaindicator.com/blog/volume-weighted-moving-average/
Published: 2026-05-15T09:00:00+05:30
Modified: 2026-05-06T06:00:00+05:30
Category: Indicators
Type: Spoke (hub: moving-averages-complete-guide)

The **Volume-Weighted Moving Average (VWMA)** uses a different kind of weight than the time-based moving averages we have covered elsewhere. Where SMA gives every bar equal weight and WMA gives recent bars more weight by position, VWMA gives **high-volume bars more weight** — regardless of when they occurred in the lookback.

This makes VWMA particularly useful on instruments where a single high-volume bar carries genuine information (think: an earnings-day breakout on a mid-cap stock, or an expiry-day spike on a NIFTY futures contract). On instruments with relatively consistent volume bar-to-bar, VWMA produces a line that looks almost identical to the equivalent SMA — same speed, same smoothness, same lag.

This guide explains the VWMA formula, walks through a worked example, contrasts VWMA with VWAP (an often-confused cousin), and lays out the cases where VWMA earns its keep on Indian-index futures and high-volume stocks.

## The formula

For a closing-price series `P` and a corresponding bar-volume series `V`, the Volume-Weighted Moving Average over a window of `n` bars is:

```
        Σ (P_i × V_i)    for i from t-n+1 to t
VWMA = ───────────────
        Σ (V_i)          over the same window
```

Multiply each close by its bar's volume, sum the products across the lookback, then divide by the sum of volumes. The result is a price weighted by where the volume happened.

Note the asymmetry: a bar with double the average volume contributes twice as much to the VWMA as a bar with average volume — even if the two bars are right next to each other in the lookback. This is what distinguishes VWMA from time-based moving averages.

## A worked example — 5-period VWMA

Suppose the last 5 daily NIFTY 50 futures bars are:

| Day | Close | Volume |
|---|---|---|
| t−4 | 24,000 | 100k |
| t−3 | 24,100 | 80k |
| t−2 | 24,250 | 200k (expiry-day spike) |
| t−1 | 24,200 | 90k |
| t | 24,400 | 110k |

**Numerator:** `(24,000 × 100k) + (24,100 × 80k) + (24,250 × 200k) + (24,200 × 90k) + (24,400 × 110k)`

= `2,400,000,000 + 1,928,000,000 + 4,850,000,000 + 2,178,000,000 + 2,684,000,000`

= `14,040,000,000`

**Denominator:** `100k + 80k + 200k + 90k + 110k = 580k`

**VWMA** = `14,040,000,000 / 580,000 = 24,207`.

Compare to the 5-period SMA: `(24,000 + 24,100 + 24,250 + 24,200 + 24,400) / 5 = 24,190`.

The VWMA, at 24,207, is slightly higher than the SMA because the high-volume bar at t−2 (price 24,250) gets disproportionate weight — pulling the average toward that day's price.

## VWMA vs VWAP — different tools

A common confusion: VWMA and VWAP both incorporate volume, but they are very different indicators.

**VWAP (Volume-Weighted Average Price)** is a single-day intraday metric. It averages every trade from market open to the current moment, weighted by volume. It resets at session open. VWAP tells institutions — and retail traders watching them — whether they are buying above or below the average price for the day. It is a benchmark, not a moving average.

**VWMA (Volume-Weighted Moving Average)** is a rolling moving average over the last N bars, where N is independent of the trading session. It slides forward as time passes. VWMA shows the volume-weighted average price over the recent past — a smoothed indicator, not a session benchmark.

You can use both in the same trading system. VWAP for intraday entries and risk; VWMA for trend definition. They answer different questions.

## When VWMA matters and when it does not

**Where VWMA earns its keep:**

- **Single stocks with episodic high-volume bars.** Earnings days, breakout days, news-driven gaps — these are bars where the price move is supported by genuine institutional flow. VWMA gives those bars extra weight, making the moving average more responsive to "real" moves and less sensitive to low-volume drift.
- **Futures contracts with expiry / rollover effects.** NIFTY futures volume spikes around expiry; VWMA captures this without being thrown off.
- **Stocks during accumulation / distribution phases.** When volume rises ahead of price (smart-money accumulation), VWMA can flag the shift earlier than SMA.

**Where VWMA does not differ from SMA:**

- **Cash index NIFTY 50.** Cash-index volume is the aggregate of constituent volumes — relatively consistent bar-to-bar. The volume weighting changes the moving average by less than a few basis points. VWMA on cash NIFTY is essentially indistinguishable from SMA at the same period.
- **Highly liquid large-cap stocks in normal markets.** Reliance, HDFC Bank, TCS — when volume is consistent and price action smooth, VWMA and SMA produce overlapping lines.
- **24-hour markets like crypto.** Volume is more uniform across bars; VWMA loses its edge.

## VWMA vs VWAP vs MA decision flow

A quick decision tree:

- Trading a **single intraday session**, want to know if your fill is above/below average institutional price? Use **VWAP**.
- Trading a **multi-day trend** on a **stock or futures contract** where volume is meaningful? Use **VWMA**.
- Trading a **multi-day trend** on a **broad index** like cash NIFTY 50? Use **SMA** or **EMA** — VWMA adds little.
- Trading a **fast intraday momentum** on a noisy timeframe? Use **EMA**, **DEMA**, or **HMA** — speed matters more than volume here.

## VWMA on Indian-index futures

For **NIFTY 50 futures** specifically, VWMA can be a useful trend filter on daily charts during expiry weeks. The expiry-day spike concentrates volume into a single bar, and VWMA gives that bar appropriate emphasis. SMA, by treating it equally with quieter days, can drift away from the actual price action of the high-volume day.

In typical non-expiry weeks, the difference between 50-VWMA and 50-SMA on NIFTY futures daily is small — maybe 5-15 index points at most. During expiry weeks, the gap can widen to 30-50 points. For traders who pay attention to expiry-day market structure, that gap is informative.

For **BANK NIFTY futures**, VWMA captures the volume spikes around RBI policy days, weekly expiry, and major bank earnings. Same logic — VWMA gives extra weight to days that materially affected price discovery.

## Implementation

In **Pine Script** (TradingView):

```pine
//@version=5
indicator("VWMA", overlay=true)
length = input.int(20, title="Period")
vwma_val = ta.vwma(close, length)
plot(vwma_val, color=color.purple, linewidth=2)
```

In **Python / pandas**:

```python
import pandas as pd

def vwma(prices: pd.Series, volumes: pd.Series, n: int) -> pd.Series:
    pv = prices * volumes
    return pv.rolling(n).sum() / volumes.rolling(n).sum()
```

Two lines if you have a clean OHLCV DataFrame. Most charting platforms have VWMA built in.

## Common VWMA settings

- **20-VWMA** on daily — a standard "20-day volume-weighted average" filter, useful for stocks
- **50-VWMA** on daily — primary trend filter on stock and futures contracts
- **9 / 21-VWMA** on 15-min for intraday momentum on volume-meaningful instruments
- **200-VWMA** on daily — long-term trend backdrop

For Indian-index cash, 50-VWMA on daily is the most useful single setting — combined with the live regime tools, it can serve as the primary trend filter.

## Putting it together

VWMA is a moving average with a different kind of weight: each bar contributes in proportion to its volume rather than its time-position. The formula is simple — sum of (price × volume) divided by sum of volume — but the implications change based on whether the underlying instrument has informative volume bars.

For NIFTY 50 cash, VWMA is essentially equivalent to SMA. For NIFTY futures, individual stocks, and any instrument with episodic high-volume events, VWMA adds genuine signal. As with every moving-average indicator on this site, the right approach is to use VWMA as one component of a setup that also checks regime, multi-timeframe alignment, and recent whipsaw rate. See the live tools at [emaindicator.com](/) and the full [methodology page](/methodology/) for the complete framework.

## Frequently asked questions

**What is the Volume Weighted Moving Average?**

VWMA is a moving average where each bar's contribution is weighted by its trading volume. Bars with high volume influence the average more than bars with low volume. The formula is sum(price × volume) over the lookback divided by sum(volume) over the same lookback.

**What is the formula for VWMA?**

VWMA = Σ(P_i × V_i) / Σ(V_i) for i from t-n+1 to t. Multiply each closing price in the lookback window by its bar's volume, sum the products, then divide by the total volume across the lookback. The result is a price-weighted-by-volume average.

**What is the difference between VWMA and VWAP?**

VWAP (Volume-Weighted Average Price) is a single-day intraday metric — it averages all trades from market open to the current bar, weighted by volume. VWMA is a rolling moving average — it slides over a fixed lookback (e.g., 20 bars) and recomputes as the window moves forward. VWAP resets at session open; VWMA keeps rolling.

**Does VWMA work on NIFTY 50?**

VWMA works on NIFTY 50 futures (where volume data is meaningful) and on individual stocks. On the cash NIFTY 50 index itself, volume data is the sum of constituent volumes, which can be noisy and less informative than futures volume. For most retail traders comparing moving averages on NIFTY, the cash index VWMA differs little from a plain SMA.

**Is VWMA better than SMA?**

On instruments where volume varies significantly bar-to-bar — single stocks, futures contracts — VWMA captures information SMA misses. A bar with double the average volume tells you something stronger than a bar at average volume. On instruments with consistent volume — broad indices, large-cap stocks in normal markets — VWMA and SMA produce nearly identical lines.
