Skip to main content

vwap

Calculate the Volume Weighted Average Price (VWAP).

Measures the average typical price by volume. It is typically used with intraday charts to identify general direction. It helps to understand the true average price factoring in the volume of transactions, and serves as a benchmark for assessing the market's direction over short periods, such as a single trading day.

Example​

from openbb import obb

stock_data = obb.equity.price.historical(symbol='TSLA', start_date='2023-01-01', provider='fmp')
vwap_data = obb.technical.vwap(data=stock_data.results, anchor='D', offset=0)

Parameters​

NameTypeDescriptionDefaultOptional
dataList[Data]List of data to be used for the calculation.False
indexstrIndex column name to use with data, by default "date".dateFalse
anchorstrAnchor period to use for the calculation, by default "D".DFalse
offsetintOffset from the current period, by default 0.0False

Returns​

OBBject
results : List[Data]
The calculated data.