VWMA Indicator: Volume-Weighted Moving Average Formula, VWMA vs SMA and VWMA vs VWAP
The volume-weighted moving average weights each close by the volume traded on its bar; here is the formula, how to read its gap with a simple average of the same length, how it differs from VWAP, and what the gap showed on daily Bitcoin in 2026.

On this page
The volume-weighted moving average (VWMA) is a moving average in which each close counts in proportion to the volume traded on its bar. Over the last n bars, it adds up close times volume and divides by the total volume. Heavily traded bars pull the average toward their price, quiet bars barely move it. Charted next to a simple moving average of the same length, it shows at what prices the volume of the window changed hands.
VWMA(20) and SMA(20) on daily Bitcoin

- Price, daily candles (hollow up, filled down)
- VWMA(20), closes weighted by volume (solid line)
- SMA(20), same length without volume (dashed line)
How the VWMA is calculated
LuxAlgo gives the formula: the sum of price times volume over the last n bars, divided by the sum of volume over the same bars, with the close as the usual price and n commonly 20. If volume is equal on every bar, the VWMA equals the simple average of the same length.
VWMA against the SMA
The usual reading compares the VWMA with a simple average of the same length. According to LuxAlgo, a VWMA above the SMA says the window’s heavier volume traded at higher prices, and a VWMA below it says volume was concentrated at lower prices. TradingView’s help page describes the same comparison. The gap says nothing about direction by itself: it shows where volume sat within the last n bars.
| What you see | What it says |
|---|---|
| VWMA above the SMA | Bars with more volume closed higher within the window |
| VWMA below the SMA | Bars with more volume closed lower within the window |
| VWMA and SMA almost equal | Volume was spread evenly, or did not depend on price |
| Sudden jump in the gap, then a sudden drop n bars later | One very heavy bar entered the window, then left it |
VWMA vs VWAP
Both weight prices by volume, but over different spans. VWAP accumulates price times volume from a fixed anchor, usually the session open, and starts again there; it is the average price paid since the anchor. The VWMA rolls a fixed window of n bars and never resets. A VWAP reading depends on where its anchor sits; a VWMA reading depends only on its length. See our pages on the VWAP and the anchored VWAP.
VWAP resets each session, VWMA rolls

The VWMA on a real chart
The 120-day Bitcoin chart above shows the 20-day VWMA and SMA from July 1 to October 28, 2026. The VWMA was above the SMA on 62 of the 120 days (51.7%), and the two were on average 0.57% apart. The largest gap, the VWMA 4.29% above the SMA, came on August 25, four days after the heaviest day of the window: on August 21, volume was about three times the median of the window, and Bitcoin closed at 78,338.03 after opening at 73,027.02. That bar stayed in the 20-day window until September 9; the lowest gap, the VWMA 0.69% below the SMA, came on September 7.
The daily S&P 500 ETF tells another story over the same number of days, from May 8 to October 28, 2026. The ETF rose from 733.90 to 772.31, yet its VWMA sat above the SMA on only 7 of the 120 days. The two lines were on average 0.11% apart, and the widest gap, 0.33% below the SMA, came on August 25. Read the LuxAlgo way, the heavier volume of each window kept trading at its lower prices, which TradingView's help page links to higher volume on down days.
VWMA(20) and SMA(20) on the daily S&P 500 ETF

- Price, daily candles (hollow up, filled down)
- VWMA(20), closes weighted by volume (solid line)
- SMA(20), same length without volume (dashed line)
LuxAlgo points out this quirk: a single very heavy bar dominates the average for exactly n bars, then falls out, so the VWMA can move on a quiet day only because an old bar expired. Volume also needs care: the volume of our Bitcoin series is that of one exchange, not of the whole market, and on markets without a central traded volume, such as spot forex, platforms use tick counts instead.
Best VWMA settings
LuxAlgo describes 20 bars as the common length, and that is what the chart uses. A shorter length reacts faster and gives a noisier gap with the SMA, a longer one the reverse. Always compare the VWMA with an SMA of the same length, otherwise the gap mixes the effect of volume with the effect of the length.
For the averages themselves, see our moving average guide and our page on moving average crossovers. To go further on moving averages, two video courses by Steve Burns are on New Trader University: Moving Averages 101 and Moving Average Signals; we earn a commission on both links.

Does it work?
Our bench tested price crossing the VWMA and the VWMA crossing its SMA across markets after costs: the price crosses lagged the market, the bearish ones by a small, fragile margin, and the VWMA and SMA crosses showed no edge; the results are in the section below (see our methodology). Separately, we measured how often the gap points one way over the long run. On the daily S&P 500 ETF, from February 1993 to October 28, 2026, the 20-day VWMA was below the 20-day SMA on 81.9% of 8,476 days, on average 0.199% below. On daily Bitcoin, from September 2017 to October 28, 2026, it was below on 49.9% of 3,341 days. For this ETF, a VWMA below its SMA is the normal state, not a warning: read the gap against the market's own habit.
Share of days with the 20-day VWMA below the 20-day SMA

None of this is a test of trades: it describes where volume sat.
For other averages, see the ALMA indicator, or the full list of trend indicators.
Data from our test bench
Tested on our bench
We coded the 4 strategies taught on this page, buy and sell side, and ran them on stocks, ETFs, indices, crypto and commodities. With all markets pooled (daily bars): 2 did worse than the market, 2 showed no edge.
Price crosses the VWMA, bullishLagged the market
Entry: Close crosses above VWMA(20). Exit: Opposite signal (stop and reverse).
The trade itself made money on average, but less than the rest of the market over the same bars.
In detail, all markets pooled
On daily bars, the rule fired 512,517 times on 2,331 assets (stocks, ETFs, indices, crypto pairs and commodity futures) between 1970 and 2026, about once every 16 bars on each asset.
The average trade returned +0.39% before costs and the median trade −1.21%; 27% of trades made money, and the gains added up to 1.20 times the losses.
A trade lasted 4 bars at the median, half of them between 1 and 13 bars.
Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.20% per trade after costs (95% interval −0.24% to −0.16%).
- Signals
- 512,5172,331 assets, 1970 to 2026
- Average trade
- +0.39%before costs; median −1.21%
- Winning trades
- 27%profit factor 1.20
- Median hold
- 4 barshalf between 1 and 13
- Vs the market, after costs
- −0.20%95% interval −0.24% to −0.16%
After the signal, bar by bar
Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).
| Bars after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 49.8% | 51.7% | 51.9% | 53.2% | 54.5% |
| Random dates | 50.6% | 51.9% | 52.6% | 53.6% | 54.6% |
Over time
The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 1970 to 2012 | 170,841 | −0.13% |
| 2012 to 2021 | 170,984 | −0.08% |
| 2021 to 2026 | 170,692 | −0.07% |
Stress tests
The same trades, measured again under harsher assumptions (vs market, after costs).
| Variant | Vs market | Result |
|---|---|---|
| As tested: entry at the signal close, standard costs | −0.20% | |
| Entry at the next bar's open | −0.22% | Holds |
| Trading costs doubled | −0.30% | Holds |
| 1% most extreme trades trimmed on each side | −0.35% | Holds |
With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 38% of 510,442 trades hit the target first, for +0.16 R per trade on average against +0.15 R for the same trade at random dates of the same assets: no measurable difference from random dates.
Worst single trade of the whole test: −62.4% on NKTR, signal of 2022-03-09.
Real trades from the test
Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Stocks | daily | 450,026 | +0.32% | 27% | −0.20% | Lagged the market |
| ETFs | daily | 15,705 | +0.26% | 30% | −0.08% | No edge found |
| Indices | daily | 6,655 | +0.47% | 32% | n/a | Not measured |
| Crypto | daily | 35,270 | +1.31% | 22% | −0.22% | No edge found |
| Commodities | daily | 4,861 | +0.23% | 26% | −0.19% | No edge found |
| Crypto | 4-hour | 234,756 | +0.03% | 24% | −0.30% | Lagged the market |
| All markets | weekly | 91,472 | +2.34% | 29% | −0.42% | Inconclusive |
| Stocks | weekly | 82,834 | +1.99% | 29% | −0.41% | Inconclusive |
| ETFs | weekly | 2,964 | +1.76% | 34% | −0.02% | No edge found |
| Indices | weekly | 1,351 | +2.30% | 36% | −0.15% | No edge found |
| Crypto | weekly | 3,319 | +17.27% | 28% | n/a | Not measured |
| Commodities | weekly | 1,004 | +1.46% | 27% | −0.63% | No edge found |
Price crosses the VWMA, bearishLagged the market, fragile
Entry: Close crosses below VWMA(20). Exit: Opposite signal (stop and reverse).
In detail, all markets pooled
On daily bars, the rule fired 516,626 times on 2,333 assets (stocks, ETFs, indices, crypto pairs and commodity futures) between 1970 and 2026, about once every 16 bars on each asset.
The average trade returned −0.44% before costs and the median trade −1.38%; 22% of trades made money, and the gains added up to only 0.79 times the losses. For this sell signal, a trade gains when the price falls (a short sale).
A trade lasted 3 bars at the median, half of them between 1 and 10 bars.
Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.16% per trade after costs (95% interval −0.19% to −0.14%). For a sell signal, a positive number means the asset did worse than the others, as the signal announced.
- Signals
- 516,6262,333 assets, 1970 to 2026
- Average trade
- −0.44%before costs; median −1.38%
- Winning trades
- 22%profit factor 0.79
- Median hold
- 3 barshalf between 1 and 10
- Vs the market, after costs
- −0.16%95% interval −0.19% to −0.14%
After the signal, bar by bar
Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).
| Bars after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 47.6% | 47.5% | 46.7% | 46.3% | 45.6% |
| Random dates | 48.2% | 47.5% | 47.0% | 46.2% | 45.3% |
Over time
The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 1970 to 2012 | 172,235 | −0.07% |
| 2012 to 2021 | 172,279 | −0.04% |
| 2021 to 2026 | 172,112 | −0.07% |
Stress tests
The same trades, measured again under harsher assumptions (vs market, after costs).
| Variant | Vs market | Result |
|---|---|---|
| As tested: entry at the signal close, standard costs | −0.16% | |
| Entry at the next bar's open | −0.13% | Does not hold |
| Trading costs doubled | −0.27% | Holds |
| 1% most extreme trades trimmed on each side | −0.18% | Holds |
The result no longer holds when entering at the next bar's open instead of the signal close.
With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 28% of 513,572 trades hit the target first, for −0.15 R per trade on average against −0.16 R for the same trade at random dates of the same assets: no measurable difference from random dates.
Worst single trade of the whole test: −313.2% on DOGE/USDT, signal of 2021-01-11.
Real trades from the test
Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Stocks | daily | 452,721 | −0.54% | 22% | −0.16% | Lagged the market, fragile |
| ETFs | daily | 15,700 | −0.31% | 21% | −0.06% | No edge found |
| Indices | daily | 6,651 | −0.20% | 22% | n/a | Not measured |
| Crypto | daily | 36,677 | +0.72% | 31% | −0.24% | No edge found |
| Commodities | daily | 4,877 | −0.32% | 23% | −0.20% | No edge found |
| Crypto | 4-hour | 235,628 | −0.02% | 27% | −0.29% | Lagged the market |
| All markets | weekly | 94,345 | −1.90% | 20% | −0.20% | No edge found |
| Stocks | weekly | 85,139 | −1.99% | 19% | −0.19% | No edge found |
| ETFs | weekly | 2,989 | −1.00% | 20% | +0.05% | No edge found |
| Indices | weekly | 1,353 | −0.82% | 19% | −0.32% | Lagged the market |
| Crypto | weekly | 3,866 | −0.71% | 36% | n/a | Not measured |
| Commodities | weekly | 998 | −1.09% | 22% | −0.35% | No edge found |
VWMA crosses the SMA of the same length, bullishNo edge found
Entry: VWMA(20) closes above SMA(20): volume concentrated at higher prices. Exit: Opposite signal (stop and reverse).
In detail, all markets pooled
On daily bars, the rule fired 335,495 times on 2,328 assets (stocks, ETFs, indices, crypto pairs and commodity futures) between 1970 and 2026, about once every 25 bars on each asset.
The average trade returned +0.58% before costs and the median trade +0.11%; 51% of trades made money, and the gains added up to 1.23 times the losses.
A trade lasted 7 bars at the median, half of them between 2 and 16 bars.
Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.15% per trade after costs (95% interval −0.19% to −0.10%).
- Signals
- 335,4952,328 assets, 1970 to 2026
- Average trade
- +0.58%before costs; median +0.11%
- Winning trades
- 51%profit factor 1.23
- Median hold
- 7 barshalf between 2 and 16
- Vs the market, after costs
- −0.15%95% interval −0.19% to −0.10%
After the signal, bar by bar
Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).
| Bars after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 50.5% | 51.8% | 52.6% | 53.6% | 54.8% |
| Random dates | 50.6% | 52.0% | 52.7% | 53.7% | 54.8% |
Over time
The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 1970 to 2012 | 111,864 | −0.06% |
| 2012 to 2020 | 111,843 | −0.02% |
| 2020 to 2026 | 111,788 | −0.05% |
With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 38% of 333,996 trades hit the target first, for +0.15 R per trade on average against +0.15 R for the same trade at random dates of the same assets: no measurable difference from random dates.
Worst single trade of the whole test: −90.7% on SUNE, signal of 2025-03-24.
Real trades from the test
Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Stocks | daily | 299,884 | +0.60% | 52% | −0.13% | No edge found |
| ETFs | daily | 9,916 | +0.32% | 54% | +0.001% | No edge found |
| Indices | daily | 4,485 | +0.56% | 56% | n/a | Not measured |
| Crypto | daily | 18,342 | +0.52% | 37% | −0.60% | No edge found |
| Commodities | daily | 2,868 | +0.71% | 52% | +0.09% | No edge found |
| Crypto | 4-hour | 134,063 | +0.02% | 42% | −0.30% | Lagged the market |
| All markets | weekly | 61,893 | +1.83% | 55% | −0.29% | No edge found |
| Stocks | weekly | 56,723 | +1.70% | 55% | −0.27% | No edge found |
| ETFs | weekly | 1,792 | +1.01% | 57% | −0.14% | No edge found |
| Indices | weekly | 958 | +2.45% | 59% | +0.23% | No edge found |
| Crypto | weekly | 1,621 | +10.12% | 31% | n/a | Not measured |
| Commodities | weekly | 799 | +1.78% | 55% | −0.32% | No edge found |
VWMA crosses the SMA of the same length, bearishNo edge found
Entry: VWMA(20) closes below SMA(20): volume concentrated at lower prices. Exit: Opposite signal (stop and reverse).
In detail, all markets pooled
On daily bars, the rule fired 337,653 times on 2,330 assets (stocks, ETFs, indices, crypto pairs and commodity futures) between 1970 and 2026, about once every 25 bars on each asset.
The average trade returned −0.69% before costs and the median trade −0.70%; 43% of trades made money, and the gains added up to only 0.78 times the losses. For this sell signal, a trade gains when the price falls (a short sale).
A trade lasted 8 bars at the median, half of them between 3 and 19 bars.
Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.10% per trade after costs (95% interval −0.14% to −0.07%). For a sell signal, a positive number means the asset did worse than the others, as the signal announced.
- Signals
- 337,6532,330 assets, 1970 to 2026
- Average trade
- −0.69%before costs; median −0.70%
- Winning trades
- 43%profit factor 0.78
- Median hold
- 8 barshalf between 3 and 19
- Vs the market, after costs
- −0.10%95% interval −0.14% to −0.07%
After the signal, bar by bar
Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).
| Bars after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 47.9% | 47.4% | 46.8% | 46.4% | 45.1% |
| Random dates | 48.1% | 47.4% | 46.9% | 46.0% | 45.1% |
Over time
The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 1970 to 2012 | 112,588 | +0.03% |
| 2012 to 2020 | 112,544 | −0.004% |
| 2020 to 2026 | 112,521 | −0.03% |
With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 28% of 335,742 trades hit the target first, for −0.15 R per trade on average against −0.16 R for the same trade at random dates of the same assets: no measurable difference from random dates.
Worst single trade of the whole test: −432.6% on NU/USDT, signal of 2021-09-29.
Real trades from the test
Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Stocks | daily | 301,591 | −0.72% | 42% | −0.08% | No edge found |
| ETFs | daily | 9,939 | −0.58% | 39% | +0.02% | No edge found |
| Indices | daily | 4,489 | −0.41% | 39% | n/a | Not measured |
| Crypto | daily | 18,765 | −0.46% | 52% | −0.66% | Lagged the market |
| Commodities | daily | 2,869 | −0.34% | 48% | −0.002% | No edge found |
| Crypto | 4-hour | 134,920 | −0.11% | 47% | −0.30% | Lagged the market |
| All markets | weekly | 63,152 | −3.92% | 38% | −0.002% | No edge found |
| Stocks | weekly | 57,996 | −3.97% | 38% | +0.03% | No edge found |
| ETFs | weekly | 1,814 | −3.61% | 33% | −0.32% | No edge found |
| Indices | weekly | 967 | −1.87% | 33% | +0.005% | No edge found |
| Crypto | weekly | 1,590 | −5.77% | 50% | n/a | Not measured |
| Commodities | weekly | 785 | −1.36% | 43% | −0.39% | No edge found |
Each strategy enters at the close of the signal bar and exits at the exit it teaches, without a stop. The test compares the asset with an equal-weight basket of the other assets of its market over exactly the same bars, net of trading costs; for a sell signal, beating the market means the asset did worse than the others. A result is shown as beating or lagging the market only when it survives a correction for the number of tests and holds in both halves of the history; it is marked fragile when entering at the next open, doubling costs or trimming extreme trades removes it. Daily index bars are not compared with other indices, because their closes fall at different hours; “Not measured” also covers samples too small to test. Rules were fixed before any result was seen. How we test
Frequently asked questions
What is the difference between VWAP and VWMA?
VWAP accumulates price times volume from a fixed anchor, usually the session open, and resets there. The VWMA uses a rolling window of the last n bars and never resets. Both weight prices by volume. See our page on the VWAP.
How do you calculate a volume weighted average?
Multiply each close by the volume of its bar, add these products over the last n bars, and divide by the total volume of the same bars. With closes 100, 102, 104 and volumes 1,000, 1,000, 3,000, the result is 102.8.
What are the best VWMA settings?
20 bars is the common length. No length has been shown to be the best; compare the VWMA with an SMA of the same length so the gap shows only the effect of volume.
What does it mean when the VWMA is above the SMA?
That the bars with more volume in the window closed at higher prices than the others. It describes where volume traded, not where price will go.
