"""Calculate a fixed-window volume-weighted mean.

A rolling VWMA does not reset by session like a session VWAP.
All inputs are synthetic teaching examples. Run: python 22_rolling-vwma.py
"""
from tv_math import *

v=weighted_mean([100,101,104][-2:],[10,20,30][-2:])
assert abs(v-102.8)<1e-12
print(v)
