Skip to content

vwap()

Get the Volume Weighted Average Price from a candlestick aggregate

Since 1.14.0

Get the Volume Weighted Average Price from a candlestick aggregate.

For Candlesticks constructed from data that is already aggregated, the Volume Weighted Average Price is calculated using the typical price for each period (where the typical price refers to the arithmetic mean of the high, low, and closing prices).

The syntax is:

vwap(
candlestick Candlestick
) RETURNS DOUBLE PRECISION
NameTypeDefaultRequiredDescription
candlestickCandlestick-✔Candlestick aggregate
ColumnTypeDescription
vwapDOUBLE PRECISIONThe volume-weighted average price. NULL when any aggregated row had a NULL volume, when the total volume is not greater than 0, or when the volume-weighted price sum that the aggregate keeps is not finite, for example after an infinite or NaN tick price or volume.