ta.vwma
Average a series with each bar weighted by its volume.
ta.vwma(source, length, bars)Volume-weighted moving average: sum(source*volume)/sum(volume) over the window, volume read from bars. na when the window has no volume.
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Unit | Default | Range | Description |
|---|---|---|---|---|---|---|
source | Series | number | - | - | - | The series to read. |
length | Constant | number | - | - | 1 to 10000 | Window in observed bars. |
bars | Constant | bars | bars | na | - | Which bars to read: a declared series, or na for the chart's own. |
Output
| Name | Type | Unit |
|---|---|---|
value | number | - |
Warm-up and missing values
- Warm-up
lengthbars. Names in the warm-up are this operator’s parameters.- Missing values
- Returns na until
lengthconsecutive non-na observations are in the window. An na resets the accumulation.
Example
ta.vwma(close, 20)plot(ta.vwma(close, 20), "Volume weighted 20")