ta.vwma()
Volume Weighted Moving Average
Computes the volume-weighted moving average (VWMA): over the last length bars, each source value is weighted by volume. Heavier volume bars pull the average more, tying the trend line to where participation was largest.
Syntax
ta.vwma(source, length) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series of values to process (often close). |
| length | series int | Number of bars (length). |
Returns
Volume weighted moving average of source for length bars back.
Remarks
na values in the source series are ignored.
Code Examples
//@version=6
indicator("ta.vwma")
plot(ta.vwma(close, 15))
// same on pine, but much less efficient
pine_vwma(x, y) =>
ta.sma(x * volume, y) / ta.sma(volume, y)
plot(pine_vwma(close, 15))Trading Applications
Incorporate volume into trend analysis
Identify institutional buying/selling pressure
Compare VWMA with SMA to detect volume-driven moves
Use as a dynamic support/resistance with volume confirmation
Frequently Asked Questions
Generate ta.vwma() Code with AI
Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.vwma() and other built-in functions instantly.
Related Pine Script Functions
ta.sma() - Simple Moving Average
Learn how to use ta.sma() in Pine Script. Syntax, parameters, code examples, and trading applications for the Simple Moving Average function.
ta.ema() - Exponential Moving Average
Learn how to use ta.ema() in Pine Script. Syntax, parameters, code examples, and trading applications for the Exponential Moving Average function.
ta.wma() - Weighted Moving Average
Learn how to use ta.wma() in Pine Script. Syntax, parameters, code examples, and trading applications for the Weighted Moving Average function.
ta.swma() - Symmetrically Weighted Moving Average
Learn how to use ta.swma() in Pine Script. Syntax, code examples for the fixed 4-bar Symmetrically Weighted Moving Average.
ta.alma() - Arnaud Legoux Moving Average
Learn how to use ta.alma() in Pine Script. Syntax, parameters including offset and sigma, code examples for ALMA.