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?

#
VWAPMoving average
What it averagesThe typical price, (high + low + close) ÷ 3The close
How candles are weightedBy volume: a candle with more volume counts for moreSMA: every candle the same. EMA: the newest candles most
WindowFrom the first candle of the day to now, so it grows through the dayThe last N candles, so it slides along
RestartsAt the first candle of each dayNever
SettingNoneThe length N
Needs volumeYesNo
Candle lengthMade for candles shorter than a dayAny
Made-up example: 4 candles, the close equal to the typical priceCandle 1Candle 2Candle 3Candle 4
Price100104101106
Volume10106020

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