What Is the Volume Weighted Moving Average?
The volume-weighted moving average is a technical indicator that expresses a rolling, volume-weighted price as one line on a chart. The VWMA uses two aligned inputs for every bar for a selected price, commonly the closing price, and the volume associated with that bar. A lookback length determines how many recent bars enter each calculation.
The VWMA is a descriptive trend overlay. A rising VWMA shows that the rolling volume-weighted result is increasing, while a falling VWMA shows that the result is decreasing. Neither direction proves that price will continue moving the same way.

The VWMA combines one selected price and one volume value for each bar inside a rolling window.
What VWMA Weights
VWMA weights each bar’s selected price by the volume recorded for that same bar. A bar with twice the volume of another bar receives twice the influence in the weighted calculation, assuming both bars remain inside the lookback window.
The VWMA weighting rule differs from equal and recency weighting. A simple moving average gives every bar equal influence, while an exponential or linear weighted moving average gives newer bars more influence according to a time-based rule. VWMA influence comes from volume rather than the bar’s age alone.
What VWMA Does and Does Not Measure
VWMA measures the weighted average of one selected price observation per bar; VWMA does not measure the full distribution of transactions at every price inside each bar. If a VWMA uses closing price, the calculation assigns the bar’s total volume to that closing-price observation for weighting purposes.
For that reason, “true price,” “real value,” and “consensus price” are imprecise descriptions of VWMA. The VWMA can show how bar-level volume changes a rolling price average, but the VWMA cannot identify exactly where every unit traded within a candle. That distinction separates VWMA from analyses that organize volume by individual price level.
The formula makes this measurement boundary explicit.
VWMA Formula and Worked Calculation
The VWMA formula divides the rolling sum of price multiplied by volume by the rolling sum of volume over the same bars.
VWMA Formula
VWMA at time t = Sum of (Price × Volume) over the last n bars ÷ Sum of Volume over the last n bars

Where:
- PiP_i = selected price for bar ii
- ViV_i = volume for bar ii
- nn = number of bars in the rolling window
- tt = current bar
In simple terms:
VWMA=Total of price × volume / Total volume
The following five-bar dataset is hypothetical and exists only to demonstrate the arithmetic.
| Bar | Selected price | Volume | Price × volume |
|---|---|---|---|
| 1 | 50 | 100 | 5,000 |
| 2 | 52 | 150 | 7,800 |
| 3 | 51 | 80 | 4,080 |
| 4 | 53 | 300 | 15,900 |
| 5 | 54 | 200 | 10,800 |
| Total | 830 | 43,580 |
Five-period VWMA:
VWMA = 43,580 ÷ 830 = 52.5060
Five-period SMA:
SMA = (50 + 52 + 51 + 53 + 54) ÷ 5 = 52.0000
The VWMA is 0.5060 above the SMA because the larger volume values in this example are attached to higher pric
es. The calculation demonstrates how weighting changes an average, the calculation does not create a buy signal.
Formula Variables and Edge Cases
The VWMA calculation is valid only when price, volume, and window rules are defined consistently. The selected price may be close, open, a typical price, or another supported source, so a published value should name the source rather than assume every platform uses the same input.
The first n−1 rows normally have no full-window VWMA when the calculation requires all n bars. A zero volume sum makes the VWMA undefined because division by zero has no valid result. Missing price or volume values require an explicit handling rule, and negative volume values should be rejected unless the dataset documents a different signed-volume convention. Adjusted historical prices and volume should also use a compatible corporate-action policy.
Once the inputs are valid, the calculated values can be interpreted on a chart.
How to Read VWMA on a Chart
VWMA is read through the line’s slope, the position of price relative to the line, and the VWMA’s distance from a same-length price average. A rising VWMA means the rolling volume-weighted value is rising, a falling VWMA means the value is falling, a flat VWMA means the weighted result is changing little.
Price above VWMA means the current price is above the rolling volume-weighted average for the selected window. Price below VWMA means the current price is below that average. Those relationships describe location, not overvaluation, undervaluation, or a guaranteed reversal.
Traders may also watch whether price repeatedly reacts near VWMA. Such reactions can make VWMA a practical reference in a defined method, but the line is not a guaranteed support or resistance barrier.

VWMA vs. Same-Length SMA
Comparing VWMA with a same-length SMA isolates the effect of volume when both indicators use the same price source. If VWMA is above SMA, higher-volume bars in the window tended to carry prices above the equal-weight average. If VWMA is below SMA, higher-volume bars tend to carry prices below the equal-weight average.
A widening VWMA–SMA gap means volume weighting is creating a larger difference from equal weighting. A narrowing gap means the two calculations are converging, which can happen when volume becomes more uniform or when influential bars leave the rolling window.
The VWMA–SMA relationship does not prove that buyers or sellers caused the difference. The relationship shows how the recorded bar volumes are distributed across the selected bar prices. Choosing between VWMA and nearby indicators therefore requires comparing their weighting and window rules.
VWMA vs. VWAP, SMA, EMA, and LWMA
VWMA is a rolling volume-weighted average, while VWAP is an anchor-cumulative volume-weighted average, SMA is equal-weighted, and EMA and LWMA apply recency-based weights. No indicator is universally better, the appropriate indicator depends on the question the trader wants the calculation to answer.
Comparison Table
The main difference among VWMA, VWAP, SMA, EMA, and LWMA is how each indicator assigns weight and defines its calculation window.
| Indicator | Weighting rule | Window behavior | Reset or anchor | Common price source | Useful question | Main limitation |
|---|---|---|---|---|---|---|
| VWMA | Each bar price is weighted by corresponding bar volume | Rolling last n n bars | No scheduled reset | Often close; platform setting may vary | How does volume alter the rolling price trend? | Lags and depends on volume-feed quality |
| VWAP | Each source price is weighted by volume | Accumulates from an anchor | Commonly session, but week, month, and event anchors may be available | Typical price such as HLC3 is common | What is the volume-weighted average since the selected anchor? | Result depends on anchor and source settings |
| SMA | Every selected price receives equal weight | Rolling last n n bars | No scheduled reset | Commonly close | What is the equal-weight average over the window? | Ignores volume and reacts slowly |
| EMA | Recent prices receive exponentially greater weight | Recursive recency-weighted series | No scheduled reset | Selected price series | How can recent price changes receive more influence? | Can react to noise and whipsaw |
| LWMA | Newer prices receive linearly greater predetermined weights | Rolling last n n bars | No scheduled reset | Selected price series | How can the newest bars receive linearly more influence? | “Weighted” refers to recency, not volume |
VWAP is usually the clearer choice for a benchmark measured from a session or event anchor. VWMA is usually the clearer choice for a rolling trend measure that should incorporate bar volume. SMA, EMA, and LWMA remain price-based alternatives when equal or recency weighting better matches the analysis.
The weighting rule answers only part of the decision because the selected length, timeframe, price source, and volume feed also shape the output.
VWMA Settings: What Does VWMA (20) Mean?
VWMA (20) means the VWMA uses the most recent 20 bars on the active chart. The number 20 identifies bars, not a fixed amount of clock time, so the covered duration changes with the chart timeframe.
| Chart timeframe | A 20-period VWMA covers |
|---|---|
| 1-minute | The latest 20 one-minute bars |
| 5-minute | The latest 20 five-minute bars, or 100 minutes of bar intervals |
| 1-hour | The latest 20 hourly bars |
| Daily | The latest 20 trading-session bars |
Market closures, missing bars, session templates, and extended-hours settings can make the elapsed clock time differ from simple multiplication. A 20-period default is a starting configuration, not evidence that 20 is the best length for every instrument, timeframe, or objective.
Price Source, Timeframe, and Volume Data
VWMA settings are interpretable only when the price source, timeframe, and meaning of the volume field are known. A close-based VWMA can differ from a typical-price VWMA even when both use the same length and volume series.
Volume can also represent different observations. Exchange-traded markets may provide reported trade volume, while some broker or provider feeds use tick volume or another feed-specific measure. MetaTrader, for example, distinguishes tick volume and real volume in its data constants and functions. A VWMA computed from one feed should not be assumed to match a VWMA from another feed.
Period selection should be treated as a testable parameter. A shorter VWMA usually changes sooner because observations leave the window sooner, while a longer VWMA usually changes more gradually. The suitable length depends on the instrument, timeframe, feed, and rule set, not on a universal setting.
Once the data and settings are fixed, VWMA can be placed inside explicit trading rules.
How Traders Use VWMA
Traders use VWMA as a trend filter, a relative-price reference, a pullback reference, or one condition in a crossover method. VWMA should describe context within a rule set rather than serve as an automatic prediction.
A trend filter may permit long setups only when VWMA is rising and price is above the line. A relative-price rule may compare the close with VWMA without treating the difference as a valuation judgment. A pullback rule may watch how price behaves near VWMA, while a crossover rule may compare VWMA with a same-source moving average. Each use still requires entry timing, invalidation, exit, and risk rules.
Hypothetical VWMA–SMA Strategy Example
A hypothetical VWMA–SMA strategy can test whether volume weighting adds information beyond an equal-weight average. The following rule card defines a research example and reports no expected return, win rate, or trading edge.
| Rule component | Hypothetical specification |
|---|---|
| Context | Use a liquid instrument and a documented, consistent volume feed |
| Indicators | 20-period VWMA and 20-period SMA using the same selected price source |
| Long signal | VWMA crosses above SMA after the bar closes |
| Confirmation | The closing price is above both averages and VWMA has a positive one-bar slope |
| Entry timing | Model entry at the next bar’s available execution price, not at the already-known signal close |
| Invalidation | Exit or invalidate according to a predefined opposite-close or opposite-cross rule |
| Risk | Set position size from a fixed risk budget and a separately defined market-structure stop |
| No-trade condition | Missing/zero volume, inconsistent session data, or an undefined full-window VWMA |
| Cost model | Include commission, spread, slippage, and financing where applicable |
| Test status | Not tested; no performance claim is available |
The hypothetical strategy separates the observed crossover from the later execution assumption. That separation prevents a backtest from entering at a price known only after the signal bar closes.

Why a Crossover Is Not a Complete Strategy
A VWMA crossover is not a complete strategy because a crossover defines a signal condition but does not define execution, risk, costs, or evaluation. Community discussions about VWMA frequently raise late signals, ending trends, and the need for confirmation; those concerns reflect missing rules rather than proof for or against the indicator.
Before interpreting a backtest, verify:
- The instrument, venue, session, timeframe, and volume feed
- The price source and equal indicator lengths
- The precise bar on which a signal becomes known
- The next executable price and treatment of gaps
- Commission, spread, slippage, financing, and contract changes
- Missing data and corporate-action adjustments
- An in-sample and untouched out-of-sample period
- Sensitivity to nearby VWMA lengths rather than one optimized value
- Drawdown, exposure, turnover, and a relevant benchmark
- Forward testing before any live use
An implementation must reproduce those calculation and timing rules without adding future information.
How to Calculate VWMA in Python
VWMA can be calculated in Python by dividing a rolling sum of “price × volume” by a rolling sum of “volume” over the same window. The implementation should preserve row order, require a complete window when intended, and return an undefined value when the rolling denominator is zero.
The calculation uses standard pandas rolling sums. The Python function should name the price and volume columns explicitly so the result can be traced to its inputs.
Python Example
The following pandas function calculates a trailing VWMA without using future rows.
import pandas as pd
def add_vwma(
frame: pd.DataFrame,
window: int = 20,
price_col: str = "close",
volume_col: str = "volume",
) -> pd.DataFrame:
"""Return a copy with a trailing VWMA column and no look-ahead."""
if window < 1:
raise ValueError("window must be at least 1")
result = frame.copy()
price = pd.to_numeric(result[price_col], errors="coerce")
volume = pd.to_numeric(result[volume_col], errors="coerce")
numerator = (price * volume).rolling(
window, min_periods=window
).sum()
denominator = volume.rolling(
window, min_periods=window
).sum()
safe_denominator = denominator.where(denominator.ne(0))
result[f"vwma_{window}"] = numerator.div(safe_denominator)
return result
The five-row calculation table can serve as a test vector:
example = pd.DataFrame(
{
"close": [50, 52, 51, 53, 54],
"volume": [100, 150, 80, 300, 200],
}
)
calculated = add_vwma(example, window=5)
assert abs(calculated["vwma_5"].iloc[-1] - 52.5060240964) < 1e-10
The Python result is reproducible only when the production dataset uses the same price, volume, window, missing-value, and adjustment rules. Platform implementations require the same scrutiny.
VWMA on MT4 and MT5
MT4 and MT5 do not identify VWMA as one of the standard moving-average smoothing methods, so VWMA normally requires a custom indicator or custom calculation unless a broker or plugin supplies one. MetaQuotes documents standard moving-average methods as SMA, EMA, SMMA, and LWMA.
A custom VWMA should expose the lookback length, applied price, and volume type. The custom indicator should also handle insufficient bars, zero volume, recalculation, and buffer indexing. Before using a downloaded indicator, verify the source, formula, file provenance, platform version, and whether the indicator uses tick or real volume. A matching test vector should reproduce the manual calculation before any strategy test begins.
Custom implementations add operational risks to the indicator’s normal analytical limitations.
Limitations and Common Mistakes
VWMA is limited by lag, sensitivity to unusual volume, feed quality, parameter choice, and the absence of predictive certainty. VWMA summarizes historical bars, so every VWMA signal occurs after the contributing price and volume values exist.
| Limitation or mistake | Why it matters | Appropriate control |
|---|---|---|
| Treating VWMA as predictive | The calculation describes past observations | Use conditional language and test explicit rules |
| Calling VWMA “true value” | One selected price per bar does not capture every transaction price | Describe VWMA as a bar-level volume-weighted average |
| Ignoring volume provenance | Tick and exchange volume can produce different results | Document and retain the same feed |
| Treating every crossover as a trade | A signal omits execution, invalidation, risk, and costs | Use a complete, predeclared rule set |
| Assuming VWMA is support or resistance | Historical reactions do not guarantee future reactions | Treat the line as a reference, not a barrier |
| Using a single optimized length | One setting may fit noise in one sample | Test nearby lengths and untouched periods |
| Confusing LWMA with VWMA | Recency weighting and volume weighting answer different questions | Verify the formula and platform method |
| Ignoring high-volume outliers | One unusual bar can pull the VWMA sharply | Inspect event context and perform sensitivity tests |
| Comparing different sources or lengths | The comparison changes more than one variable | Match price source and period when isolating volume |
No VWMA setting or strategy is universally accurate. The usefulness of VWMA depends on a defined purpose, trustworthy inputs, and evidence from the same market conditions in which the method will be used.
Frequently Asked Questions
VWMA is not automatically equivalent to rolling VWAP, does not provide a complete standalone trading signal, and can lag because the calculation uses historical bars.
Is VWMA the same as a rolling VWAP?
VWMA and rolling VWAP can use similar volume-weighted arithmetic, but the labels do not guarantee identical values. The price source, rolling or anchored window, reset rule, session treatment, and platform implementation must match before two calculations can be considered equivalent.
Can VWMA be used as a standalone buy or sell signal?
VWMA alone does not define a complete trade. A usable method needs market context, signal timing, entry, invalidation, exit, position size, costs, and evidence from a suitable test. No VWMA line or crossover guarantees a profitable outcome.
Why can VWMA lag after a crossover?
VWMA lags because the calculation uses historical prices and volumes that remain in the rolling window until newer bars replace them. A crossover confirms that the two historical averages have changed order; a crossover does not identify the exact start of a new trend.
Conclusion
VWMA is a rolling average that uses volume to determine each bar price’s influence. VWMA is most informative when the price source, period, timeframe, and volume feed are known and when the line is compared with a same-length SMA. VWMA can support a testable method, but VWMA cannot replace execution, risk management, or evidence.

















