How it is calculated
The sum of price times volume over the last length bars, divided by the sum of the volume over the same bars. The first value comes once length bars are in. When no volume traded in the whole window the line has no value on that bar.
Reference: Volume weighted moving average
How to read it
Against an SMA of the same length it leans towards the prices where most volume traded: a VWMA above the SMA means the volume came with rising prices. For forex and CFDs the volume is usually tick volume, which only roughly stands for real turnover.
In a strategy
Compare ctx.ind("vwma", length=20) with ctx.ind("sma", length=20) and allow longs only while the VWMA is above, as a sign that volume carries the move.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 20 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| VWMA | Line |
Used in
No strategy template reads it yet.