ta.vwap
Show the average price paid across the run or within each session, weighted by volume.
ta.vwap(source, bars, reset)Volume-weighted average price accumulated from the first bar of the run, or of each period with reset: sum(source*volume)/sum(volume), volume read from bars.
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Unit | Default | Range | Description |
|---|---|---|---|---|---|---|
source | Series | number | - | - | - | Typically hlc3. |
bars | Constant | bars | bars | na | - | Which bars to read: a declared series, or na for the chart's own. |
reset | Constant | string | - | - | - | Restarts the two sums at the first bar of each session, day, week, month, quarter or year (an option, written reset=session). |
Output
| Name | Type | Unit |
|---|---|---|
value | number | - |
Warm-up and missing values
- Warm-up
- 1 bar.
- Missing values
- na until one bar with non-na volume has been seen, and again after each restart. It accumulates from the first bar of the run, or of each period with reset. reset=session never restarts on daily bars or a 24/7 calendar.
Example
ta.vwap(hlc3)plot(ta.vwap(hlc3, reset=session), "Session VWAP")