VWAP vs moving average: how the two differ
By Oalgo · Last reviewed
VWAP is the volume-weighted average price since the day began, and it restarts every day. A moving average is the average of the last N closes and runs on across days. Both draw one line on the price chart, but they answer different questions.
How do VWAP and a moving average differ?
#| VWAP | Moving average | |
|---|---|---|
| What it averages | The typical price, (high + low + close) ÷ 3 | The close |
| How candles are weighted | By volume: a candle with more volume counts for more | SMA: every candle the same. EMA: the newest candles most |
| Window | From the first candle of the day to now, so it grows through the day | The last N candles, so it slides along |
| Restarts | At the first candle of each day | Never |
| Setting | None | The length N |
| Needs volume | Yes | No |
| Candle length | Made for candles shorter than a day | Any |
| Made-up example: 4 candles, the close equal to the typical price | Candle 1 | Candle 2 | Candle 3 | Candle 4 |
|---|---|---|---|---|
| Price | 100 | 104 | 101 | 106 |
| Volume | 10 | 10 | 60 | 20 |
After candle 4 the 4-candle SMA is (100 + 104 + 101 + 106) ÷ 4 = 102.75. VWAP is (100 × 10 + 104 × 10 + 101 × 60 + 106 × 20) ÷ 100 = 102.2. Candle 3 had the most volume, so VWAP leans toward its price, and the moving average ignores volume.
At the start of a new day VWAP begins again: its first value is that candle's own typical price. A 20-candle moving average still holds yesterday's closes.
When do people use each?
#- VWAP: as a reference price for the day, with price above or below it as a filter, or an entry a set percentage away from it. The VWAP page has the details.
- A moving average: to follow the direction of a trend over a length you choose, or two averages crossing each other.
- Both: price crossing the line, with the same rule built on each to see what the volume weighting and the restart change.
How do you test the choice in Oalgo?
#In Oalgo you can tell Oalgo AI your VWAP or moving average rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
- Use candles shorter than a day for both. On candles of one day or longer VWAP is just each candle's typical price.
- Build the same rule twice, once with each line, and run a backtest of both on the same dates.
- Compare the number of trades and the fees, not only the report totals.
- Run a forward test of the one you keep, on new prices, with simulated funds.
What can neither tell you?
#Neither says where price goes next. VWAP describes what has already happened since the day began, and its value depends on where the day starts. A moving average depends on the length you pick. A cross of either line is not a turning point by itself.
Read next
- What is VWAP? The VWAP indicator explainedThe VWAP indicator is the average price of the day so far, weighted by volume and restarted each day. See how it is calculated, read and tested.
- Moving averages: SMA and EMA explainedA moving average smooths price into one line. Learn how the SMA and EMA are calculated, how they differ, and how to use them in your own rules.