"""Calculate VWAP from actual trade prices.

This is trade-weighted VWAP. Bar typical-price approximations may differ.
All inputs are synthetic teaching examples. Run: python 21_trade-vwap.py
"""
from tv_math import *

v=weighted_mean([100,102],[10,30])
assert v==101.5
print(v)
