Volume Weighted Moving Average

The Volume Weighted Moving Average (VWMA) weights each close with the volume traded in its period, so the prices at which most shares changed hands count the most.

The formula for the Volume Weighted Moving Average is as follows:

\[\text{VWMA} = \frac{\sum_{i=0}^{n - 1} \text{Close}_{t-i} \cdot \text{Volume}_{t-i}}{\sum_{i=0}^{n - 1} \text{Volume}_{t-i}}\]

Where Close(t-i) and Volume(t-i) are the close and the volume i periods ago and n the number of periods. It is read like the SMA, and the gap between the two says where the volume was: a VWMA above the SMA of the same length shows that the higher closes of the window came with the heavier volume, below it the lower closes.

A moving average smooths the price by averaging it over the last n periods, so that the trend shows through the noise of single periods. It is the oldest and most widely used trend indicator: the direction of the average shows the direction of the trend, the price above (below) it an uptrend (downtrend), and other indicators, from the MACD to the Bollinger Bands, are built on it. Every moving average trades smoothness against lag: the more periods it averages, the smoother it is and the later it turns after the price. The averages differ in how they weight the prices within the window and whether they adapt their speed to the market, each a different answer to that trade-off.

Also known as: VWMA.

In the Finance Toolkit this is get_moving_average with method="volume_weighted", the same function as Moving Average.

Example · ^GSPC · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_moving_average:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["^GSPC"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_moving_average(method="volume_weighted", window=50)

Which returns:

References

  • Paper Dormeier, B.P. (2011). “Investing with Volume Analysis.” FT Press.
  • Library Referenced against TA-Lib’s VWMA (Volume Weighted Moving Average)
  • Library Referenced against pandas-ta-classic’s vwma (Volume Weighted Moving Average)
  • Library Referenced against finta’s EVWMA (Elastic Volume Weighted Moving Average)
  • Library Shares similar logic as Tulip Indicators’ vwma (Volume Weighted Moving Average)
Share