vwap

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.vwap(source: ArrayLike,volume: ArrayLike,time_open: ArrayLike,anchor: str = 'session',anchor_time: str = '',band_mult: float = 1.0,day_boundary: str = '17:00 America/New_York') -> dict[str, np.ndarray]

Volume-weighted average price from each anchor, with bands at its weighted deviation.

Parameters

NameTypeDefault
sourceArrayLike
volumeArrayLike
time_openArrayLike
anchorstr'session'
anchor_timestr''
band_multfloat1.0
day_boundarystr'17:00 America/New_York'

Indicator: Volume-weighted average price

anchor starts the sums again at each trading day (session, from day_boundary), week or month, or once at anchor_time (time, written 2024-03-01 13:00 in UTC), with no value before it. A missing bar starts the sums again. The bands are band_mult times the volume-weighted standard deviation. No value while the volume so far is 0.

Classpython
forge.ta.VWAP(**inputs: Any) -> None

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

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.