VWAP

Definition

VWAP stands for Volume-Weighted Average Price. As per definition each point on the VWAP chart represents a price. But the price however is weighted according to trading volume. To be more specific, value of VWAP at each point if the price of the secutiry at this point multiplied to volume and divided by volume of the whole security trade at this day.

VWAP is an intra-day indicator. The value of VWAP chart is calculated throughout a trading day and reset at the start of the next trading day. VWAP gives indication how the current price is in relation to total trading done in the day taking into account volume.

In contract to Simple Moving Average and Exponential Moving Average, these indicators depend only on security price history and don’t take into account how much volume did the security trade at each bar/period. VWAP however adds the volume into calculation, so the price result is weighted for each bra trading volume.

Mathematical Formula

VWAP = (Sum of (Tick Price ×Tick Volume)) / Trading Volume

If however the Tick price is not available on the trading platform, a substitue formula can be used to calculate VWAP as follows:

VWAP = (Cumulative Typical Price × Volume) / Cumulative Volume

Where:

Cumulative Typical Price = (High + Low + Close) / 3

Cumulative Volumne is the total trading volume from day start until the calculation point

Usage

If the current price of a security is above VWAP value, it’s usually an indication the security price is too high from average price and it’s an indication to sell or take short position. However if the current price of a security is way below VWAP value, it’s usually an indication that price is too low from average price during this trading day and it’s indication to buy or take long position.

However, traders must keep in mind that VWAP is a lagging indicator. The reason is because VWAP calculates past values into current VWAP price value. VWAP indicator should therefore be used with caution and usually is combined with other indicators to have clear buy and sell signals.

PINE Script V6

// This Pine Script™ source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// © user_VWAP_script


//@version=6

indicator("VWAP (using ta.vwap)", shorttitle="VWAP", overlay=true)


// Use the built-in ta.vwap function for a simpler implementation.

// This function calculates the Volume Weighted Average Price.

// By default, it resets daily.

vwap = ta.vwap((high+low+close)/3) // use (high+low+close)/3 for price calculation


// Plot the VWAP line on the chart

plot(vwap, color=color.blue, linewidth=2, title="VWAP")

Sources