Volume weighted moving average
All indicators

LibraryTrend

Indicator

Volume weighted moving average

An average of recent prices in which each bar counts in proportion to the volume traded on it.

TrendOn the price2 inputsVWMA

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

InputTypeDefaultRange or choices
LengthlengthWhole number20min 1, max 5000
SourcesourcePrice"close"close, open, high, low, hl2, hlc3, ohlc4, hlcc4

What it draws

LineDrawn as
VWMALine

Used in

No strategy template reads it yet.

OrionQuant