Login Page - Create Account

Technical Studies Reference


Volume Weighted Average Price (VWAP) with Standard Deviation Lines


Description

This study calculates and displays the Volume Weighted Average Price (VWAP) over the specified period of time for the symbol of the chart. The period of time is set by the Time Period Type and Time Period Length Inputs.

This calculation gives greater weight to trade prices that have a higher volume. The calculation resets at the begining of each new period in the chart.

Let \(X\) be a random variable denoting the Input Data, let \(X_i\) be the value of the Input Data at chart bar \(i\), let \(V_i\) be the Volume at chart bar \(i\), and let \(n\) be the length of the period in chart bars for the calculation as specified by the Inputs Time Period Type and Time Period Length.

We begin by computing the Period Volume \(V_P\) for the period.

\(V_P = \sum_{i=1}^nV_i\)

Then the Volume Weighted Average Price during the length for the given Inputs is denoted as \(VWAP(X,n)\), and is calculated as follows.

\(VWAP(X,n) = \left(\sum_{i=1}^nX_iV_i\right)/V_P\)

The start of the trading day is determined from the Session Times set in Chart >> Chart Settings. For example, when the Time Period Length and Time Period Type Study Inputs are set to 1 Day, then the calculations will begin at the start of each trading day according to the Session Times and end at the end of the trading day.

The study also supports calculating and displaying Fixed Offet/Standard Deviation band lines, which the calculation is explained further down on this page.

Displaying or Hiding Standard Deviation/Fixed Offset Band Lines

Up to 4 Standard Deviation/Fixed Offset lines based upon the Volume Weighted Average Price line can be displayed. To display these standard deviation band lines, follow the steps below.

  • Open the Study Settings window for the Volume Weighted Average Price study on the chart. For instructions, refer to Adding/Modifying Chart Studies.
  • Select the Subgraphs tab.
  • The Standard Deviation/Fixed Offset lines are labeled Top Band 1-4 and Bottom Band 1-4. To make a line visible, set its Draw Style to Dash or another visible Draw Style. To hide it, set its Draw Style to Ignore.

Refer to the description for the Band # Std. Deviation Multiplier/Fixed Offset Input, for information about how these lines are calculated.

Differences Between VWAP and Standard Deviation Lines On Different Timeframe Bars

The VWAP is a fairly simple calculation, but is very dependent on the data that it is calculated using. For the highest accuracy and the same values on different timeframe bars, it is necessary to set the Base on Underlying Data Input to Yes, so that the study uses the underlying data that makes up the bars.

It is also necessary to have tick by tick data in the chart data file for the highest accuracy. Refer to Tick by Tick Data Configuration.

When you compare VWAPs on different timeframe bars, the values will be the same when using Base on Underlying Data so long as the starting time for the first bar used in the calculation for the VWAP period, is the same among the different bar timeframes. If Base on Underlying Data is set to No, the values will be different and this is expected.

It is expected for the VWAP values to be different among different chart bar timeframe settings when using Number of Trades, Volume, Range, Reversal, Renko, Delta Volume, Price Change, Point and Figure Bars. This is because there is not a consistent starting time for a bar with these bar types. Enabling Chart >> Chart Settings >> New Bar at Session Start can help with this.

The Standard Deviation Lines for the Volume Weighted Average Price on different timeframe bars can be different. This is because the Standard Deviation is calculated in part using the chart bar values, and the chart bar values can be significantly different between chart bar timeframes. For example, there is only every fifth value on a 5 minute bar chart versus a 1 minute bar chart.

Also refer to Resolving Differences of Chart Bars Between Charts.

Differences with VWAP Between Historical Daily and Intraday Charts

The data in a Historical Daily data chart is different than the data in an Intraday chart. When the Base on Underlying Data Input is set the Yes, there will definitely be differences in the Volume Weighted Average Price calculation between Intraday and Historical Daily data charts. For more information, refer to

There will also be differences even when the Base on Underlying Data Input is set to No because Historical Daily charts have a higher volume per bar.

Another reason for a difference between Historical Daily charts and Intraday charts with the Volume Weighted Average Price calculation is that the closing price for each bar is different. Historical Daily charts use the official settlement as compared to the last trade price at the end of the day on Intraday data charts which are set to a 1 Day period.

Standard Deviation Band Calculation

The following explanation of the standard deviation band calculation is when the Standard Deviation Band Calculation Method is set to VWAP Variance.

The Variance during one period for the given Inputs is denoted as \(Var(X,n)\), and is calculated as follows.

\(Var(X,n) =\sum_{i=1}^n\left(X_i-VWAP_i(X,n)\right)^2V_i\)

The Standard Deviation during the period for the given Inputs is denoted as \(SD(X,n)\), and is calculated as follows.

\(SD(X,n) = \sqrt{Var(X,n)}\)

Next, the Offset during the period for the given Inputs is denoted as \(Off(X,n)\), and is calculated as follows. \(V_P) is documented above.

\(Off(X,n) = \sqrt{Var(X,n)/V_P}\)

The Standard Deviation Bands are computed using a Multiplier \(b\). Let \(TB_j\) and \(BB_j\) be Top Band and Bottom Band number \(j\), respectively \((j=1,2,3,4)\). We compute the Bands for each Period as follows.

\(TB_1 = VWAP + b\cdot Off(X,n)\)
\(BB_1 = VWAP - b\cdot Off(X,n)\)
\(TB_2 = VWAP + 2b\cdot Off(X,n)\)
\(BB_2 = VWAP - 2b\cdot Off(X,n)\)
\(TB_3 = VWAP + 3b\cdot Off(X,n)\)
\(BB_3 = VWAP - 3b\cdot Off(X,n)\)
\(TB_4 = VWAP + 4b\cdot Off(X,n)\)
\(BB_4 = VWAP - 4b\cdot Off(X,n)\)

Inputs

  • Input Data
  • Volume Type to Use: Sets the data type to be used for the calculation. The following options are available:
    • Total Volume
    • Bid Volume
    • Ask Volume
    When using either Bid Volume or Ask Volume the option for Base on Underlying Data must be set to Yes or the calculation will be based on the Total Volume.
  • Base on Underlying Data: This Input setting only applies to Intraday charts and not to Historical charts.

    When this Input is set to No, which is the default, then the price and volume data for the calculations are based on the bars in the chart. The last trade price of the bar is used, which is the default, and the total volume of the chart bar is used.

    To base the calculations on the underlying price and volume data which is more detailed than the chart bars, set this Input to Yes. When this Input is set to Yes, the chart may be automatically reloaded to load in the more detailed Volume at Price data.

    It is recommended when using this setting that since Intraday charts are required, select Chart >> Chart Settings and select Chart Data Type >> Intraday Chart Only to always ensure the chart is set to use Intraday data.

    To ensure there is the most detailed data for the calculations, a Tick by Tick Data Configuration is recommended.
  • Time Period Type: Sets the type of time period for the calculation. This Input works in conjunction with Time Period Length. For a 1 Day period, set this to Days. The number of Days specified always refers to calendar days and not trading days.
  • Time Period Length: Sets the quantity to be used with Time Period Type. For example, for a period of 1 Day, set this to 1 and set Time Period Type to Days.
  • Start Date-Time: This Input can optionally be set to a starting Date-Time to begin the calculations at for the Volume Weighted Average Price study. It is necessary to specify both the Date and the Time. You cannot just specify the Time only. The Time Period Length and Time Period Type Inputs still apply when using a Start Date-Time.

    The Start Date-Time setting does not refer to the starting time of day when the Time Period Length and Time Period Type is set to set to 1 Day.

    The purpose of this Input is to reduce the amount of calculations performed within the chart by starting at a particular Date-Time.
  • Ignore Time Period Type and Length: When this Input is set to Yes, then the Inputs for Time Period Type and Time Period Length are ignored and the Volume Weighted Average Price is calculated from the first bar in the chart, or from the entered value for the Start Date-Time, if this Input is set.
  • Standard Deviation Band Calculation Method: This can be set to VWAP Variance, Fixed Offset, Standard Deviation, or Percentage. For the formulas for each, refer to Standard Deviation Band Calculation.
  • Band # Std. Deviation Multiplier/Fixed Offset: When the standard deviation Top # Band and Bottom # Band Subgraphs are set to be displayed, this Input specifies how far the band lines are from the Volume Weighted Average Price line.

    When the Standard Deviation Band Calculation Method Input is set to VWAP Variance or Standard Deviation , then this Input specifies the value multiplied by the VWAP Variance or Standard Deviation. For example, if the Input is set to 2.0, then the band would be offset by 200% of the Standard Deviation.

    When the Standard Deviation Band Calculation Method Input is set to Fixed Offset, then this Input becomes a fixed offset and is used to offset the Bands from the Volume Weighted Average Price by the specified amount. Bands 1-4 are offset by the exact amounts.

    When the Standard Deviation Band Calculation Method Input is set to Percentage, then this Input becomes the percentage of the Volume Weighted Average Price that is used to offset the Bands from the Volume Weighted Average Price. For example, if the Input is set to 2.0, then the band would be offset by 2% of the Volume Weighted Average Price.
  • Volume Type to Use: The choices for this are Total Volume, Bid Volume, Ask Volume. When this is set to Bid Volume or Ask Volume it is necessary for Base on Underlying Data to be set to Yes. Otherwise, Total Volume will be used instead.

*Last modified Thursday, 25th July, 2024.