VWAP

Calculates the Volume Weighted Average Price indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
periodNumber14-

Returns: Series<Number>

VWAP is a built-in function - you can use it directly. Below is an example implementation:

12
function VWAP(period = 14):
Sum((close + low + high) / 3 * volume, period) / Sum(volume, period)