Free trial
Contents

vwma

Volume Weighted Moving Average

vwma(source, periods)

Parameters

Name Type Description
source field Data series to calculate VWMA on
periods int Number of periods for the moving average

Formula

VWMA = Σ(field[i] * volume[i]) / Σ(volume[i])

Examples

vwma(close, 20);  # 20-period volume-weighted MA
x = vwma(close, 50); close > x;  # Price above VWMA
vwma(hlc3, 20);  # VWMA of typical price

Returns

float — may be NULL

Range

periods must be 2-400

Notes

Division by zero protection returns NULL

References

TradingView: ta.vwma()