ta.vwma() - Pine Script Function
ta.vwma()
Section titled “ta.vwma()”Overview
Section titled “Overview”The vwma function returns volume-weighted moving average of source for length bars back. It is the same as: sma(source * volume, length) / sma(volume, length).
Syntax
Section titled “Syntax”ta.vwma(source, length) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source | series int/float | Series of values to process. |
Returns
Section titled “Returns”Volume-weighted moving average of source for length bars back.
Remarks
Section titled “Remarks”- na values in the source series are ignored.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("ta.vwma")plot(ta.vwma(close, 15))// same on pine, but less efficientpine_vwma(x, y) => ta.sma(x * volume, y) / ta.sma(volume, y)plot(pine_vwma(close, 15))