Volume-weighted average price

vwapvolumeForge API 1

The average price weighted by volume since the session, week, month or a chosen time.

Inputs

NameTypeDefaultRange
sourcesourcehlc3
volumevolumetick
anchorchoicesession
anchor_timetext
band_multfloat10 to 10
day_boundarytext17:00 America/New_York

Outputs

NameTypeRequiredDescription
vwapvalueOptionalcolor theme.accent, style line, width 2
uppervalueOptionalcolor theme.series_b, style line, width 1
lowervalueOptionalcolor theme.series_b, style line, width 1
Warm-up
0 bars (0 at the defaults)
Repaints
No
Parity
None

Formula

VWAP = the running sum of volume * source over the running sum of volume, from each anchor

upper and lower = VWAP plus and minus band_mult * the volume-weighted standard deviation

A session starts at the day boundary. On forex the volume is tick volume. To anchor at a bar found in code, call it on the data from that bar.