vwma
Volume Weighted Moving Average
vwma(source, periods)
Parameters
| Name | Type | Description |
|---|---|---|
source |
source | Data series to calculate VWMA on - price field (close, open, high, low) or indicator output |
periods |
int | Number of periods for the moving average |
Formula
```
VWMA = SMA(field * volume, periods) / SMA(volume, periods)
This is equivalent to:
VWMA = Σ(field[i] * volume[i]) / Σ(volume[i])
```
Where the sum is over the specified number of periods
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
Volume-weighted moving average value ## References - TradingView: `ta.vwma()` ## Notes - More responsive to volume spikes than regular MAs - Useful for identifying support/resistance at volume clusters - Division by zero protection returns NULL