Volume Weighted Moving Average (VWMA)
A moving average that listens most to the busiest bars.
What it measures
Section titled “What it measures”The VWMA weights each close in the window by that bar’s volume. When volume is even it matches the SMA; when heavy volume comes with moves one way, the VWMA leans that way. Unlike VWAP, it covers a rolling window of bars rather than the day so far.
How traders read it
Section titled “How traders read it”Traders compare it with an SMA of the same length: a VWMA above the SMA says the heavier trading came at higher prices, which supports a rise, and below it the reverse.
Formula
Section titled “Formula”VWMA = Σ(CLOSE × VOLUME) / Σ VOLUME, over the last `periods` barsWhen the window has no volume at all it has no value.
Settings and output
Section titled “Settings and output”Call: vwma(periods)
| Setting | Chart default |
|---|---|
periods: Periods |
20 |
What you get: a number.
Warm-up: with vwma(20), it asks for 0 bars of history and a run-up of 20, and its first value came on bar 20 of the example data.
The prices are made up, hourly, and the same on every page, so the chart shows how the indicator behaves, not how a market behaved.
In an algorithm
Section titled “In an algorithm”function onIntervalClose() { const weighted = vwma(20); const plain = sma(20); if (weighted !== null && plain !== null && weighted > plain && OPEN_POSITIONS_COUNT === 0) { openPosition("BUY", { quantity: 10000, stopLossPips: 30 }); }}