Volume-weighted average price
The average price weighted by volume since the session, week, month or a chosen time.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | hlc3 | |
| volume | volume | tick | |
| anchor | choice | session | |
| anchor_time | text | ||
| band_mult | float | 1 | 0 to 10 |
| day_boundary | text | 17:00 America/New_York |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
| vwap | value | Optional | color theme.accent, style line, width 2 |
| upper | value | Optional | color theme.series_b, style line, width 1 |
| lower | value | Optional | color 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.