Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

vwap Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Kapaluamak
Posted : Wednesday, May 15, 2013 7:12:41 AM
Registered User
Joined: 6/19/2012
Posts: 15

Does the VWAP function measure the average price of all trades during a given day?  

Bruce_L
Posted : Wednesday, May 15, 2013 8:47:22 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The VWAP is price times the volume for each trade or interval all added together for the day and then divided by the total volume so far during the day. So it is the average of all trades during the day with more weight given to trades with higher volume than is given to trades with lower volume.

The VWAP price in TC2000 uses the time frame of chart for its calculations. So if you are in a 1-minute time frame, all of the volume for each minute uses the close of that minute for the VWAP calculations. You would need to be using a tick chart with enough data available to display the entire current day to get a VWAP which is actually based on the price of each individual trade.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kapaluamak
Posted : Wednesday, May 15, 2013 9:13:35 AM
Registered User
Joined: 6/19/2012
Posts: 15

so on a two minute chart is it possible to get a vwap line which gives me the vwap for the entire day's trading session?

 

Bruce_L
Posted : Wednesday, May 15, 2013 9:43:10 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Yes. It is possible to do so on a 1-minute chart as well. There are 390 minutes in a trading day and you can have up to 500 bars visible in any given time frame.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kapaluamak
Posted : Wednesday, May 15, 2013 10:17:19 AM
Registered User
Joined: 6/19/2012
Posts: 15

That would mean that the vwap would include data from the day before.  Is it possible to do a running vwap just for the current session?  

 

Bruce_L
Posted : Wednesday, May 15, 2013 10:17:56 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

No, it does not mean VWAP would include data from the day before. It resets at the beginning of each day.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kapaluamak
Posted : Wednesday, May 15, 2013 10:29:06 AM
Registered User
Joined: 6/19/2012
Posts: 15

ok, this brings me to the reason I was asking this question.  yesterday LO was showing a vwap that was 10 cents lower than some other charting systems.  even eyeballing it, it was almost impossible to be that off unless it including data from the prior day.  I was using the vwap function that is available on the indicator page on a two minute chart.

 

 

Bruce_L
Posted : Wednesday, May 15, 2013 10:39:16 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

If their VWAP is based on tick data instead of the bars on the chart and there was unusually large volume on ticks above the close of the bars being used in the calculations, then there is absolutely nothing preventing the difference.

Note that the largest volume bar for LO yesterday on a 2-minute chart is the 9:32 bar. That bar closed at the its lowest value. All of the volume for that bar was calculated in the VWAP as if it traded at the close of that bar (which was the low of the bar). If a significant percentage of the trades during that two minutes was at a price higher than the close, this alone would create a significant difference versus a VWAP calculated using tick data.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kapaluamak
Posted : Wednesday, May 15, 2013 11:01:01 AM
Registered User
Joined: 6/19/2012
Posts: 15

Maybe I misunderstand but whether its a tick or a bar, wouldn't all the information be included  using either system.  The disparity in vwap went on for most of the day, not just for one bar.

 

Bruce_L
Posted : Wednesday, May 15, 2013 11:46:49 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

All of the other bars during the day do contribute to the VWAP, but the contribution of any single one of those other bars is dwarfed by the contribution of the first 2-minute bar of the day for LO and even all of the other bars put together still contribute less to the final value of VWAP than the first 2-minute bar of the day.

Look at a volume chart for LO on a 2-minute chart. Do you see how the first bar of the day is much, much bigger than all of the other bars? The weight of any bar's contribution to the calculation of VWAP is directly proportional to its volume. By the end of the day, that first 2-minute bar still constitutes more than half of the weight used in calculating VWAP.

All of that volume is calculated in the VWAP at the closing price of that first two minute bar.

We know that there were at least some trades during that first 2-minutes that were conducted at prices higher than 43.32, because the high of the bar was 43.41 and that LO actually opened at this high. In looking at a 1-minute chart, we can see that most of the trading actually happened during the first minute.

Now let's imagine that we are calculating VWAP using tick data instead of only using the data on a 2-minute chart for the calculations.

I don't have access to historical tick data going back that far, but it is quite possible that a majority of the volume during the first 2-minute bar of the day was in trades which had prices closer to the open and high of the bar of 43.41 then to close and low of the bar of 43.32. They were certainly closer in temporal proximity. In fact, I can say with a mathematical certainty that if the VWAP was about $0.10 lower for a VWAP calculated using tick data than calculated using 2-minute data, that almost all of the volume of the first 2-minute bar of the day was at a price very close to 43.41.

So let's use 10 ticks with linearly decreasing prices and a large first trade of the day at the open as our example math.

43.41 - 2,000,000 shares
43.40 - 1000 shares
43.39 - 1500 shares
43.38 - 500 shares
43.37 - 200 shares
43.36 - 300 shares
43.35 - 100 shares
43.34 - 500 shares
43.33 - 100 shares
43.32 - 200 shares

With this tick data, we would calculate the VWAP for the first 2-minutes as:

(43.41 * 2000000 + 43.40 * 1000 + 43.39 * 1500 + 43.38 * 500 + 43.37 * 200 + 43.36 * 300 + 43.35 * 100 + 43.34 * 500 + 43.33 * 100 + 43.32 * 200) / (2000000 + 1000 + 1500 + 500 + 200 + 300 + 100 + 500 + 100 + 200) = 43.4099276591

After the first 2-minute bar, the VWAP using 2-minute data is 43.32. So at this point we are almost 9 cents lower using 2-minute data than the hypothetical tick data. By itself, this accounts for about 5 cents of the lower VWAP at the end of the day.

This is not the only 2-minute bar of the day that had a relatively large range and relatively large volume however (although it is much bigger by far than the other large volume bars of the day). So there are other bars during the day with similar differences resulting in continued lower VWAP through the day.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kapaluamak
Posted : Wednesday, May 15, 2013 12:06:32 PM
Registered User
Joined: 6/19/2012
Posts: 15

This is where I think I get confused.  If 2 million shares trade at the open at 43.41 and the remaining 1 min and 59 seconds has a bunch of significantly smaller trades at levels below but not a lot lower than the open.  How can the VWAP for the first bar 43.32?    

Bruce_L
Posted : Wednesday, May 15, 2013 12:18:02 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Because the VWAP in TC2000 is calculated entirely using the price data on the chart.

There are no tick bars on a 2-Minute Chart, so no tick data is used in the calculations.

The shortest period of time which can be used for calculating VWAP with just 2-minute data is 2-minutes.

All of the volume of an individual bar uses the closing price of that bar when calculating the VWAP so far during the day.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
looseaverse
Posted : Wednesday, May 15, 2013 1:15:11 PM
Registered User
Joined: 12/21/2010
Posts: 21

Pardon me for butting in but somewhere I heard that the VWAP is actually available from at leastg some exchanges and that it is not necessary to calcualte it locally.  Maybe that is only the end of day VWAP, I am not sure.

Kapaluamak
Posted : Wednesday, May 15, 2013 1:23:49 PM
Registered User
Joined: 6/19/2012
Posts: 15

Bruce,  Thanks for being so patient with my question.  If I wanted the most accurate running VWAP for today, how would I set that up?

 

 

Bruce_L
Posted : Wednesday, May 15, 2013 1:38:18 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The best you are probably going to be able to do in TC2000 is to use a 1-Minute Chart. That will use 1-Minute bars to calculate the VWAP. It isn't going to be tick data, but it is using smaller units of time than a 2-minute chart and you generally are not going to have enough tick data available in TC2000 to get a VWAP to plot on a tick chart.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kapaluamak
Posted : Wednesday, May 15, 2013 2:19:06 PM
Registered User
Joined: 6/19/2012
Posts: 15

With VWAP becoming a huge part of algo programs; I am surprised that worden has not tried to add this indicator on their platform.  There are only two or three competitors who do this and they appear to be gaining subscribers because of it.  Anyway, thank you for your help today.

 

 

jason.rennie
Posted : Wednesday, June 5, 2013 7:13:45 PM
Registered User
Joined: 12/28/2011
Posts: 120

Hi Bruce, It seems like calculating the correct VWAP value would be very useful to a lot of people - the version of VWAP that is provided in TC2000 is inaccurate, its value varies depending on the time frame. So its normally wrong.

Is it not possible for the worden servers to record the VWAP for the data as it streams in?

I'd like to be able to refer to it in PCFs as well..

Kind Regards,

-Jason

 

Bruce_L
Posted : Thursday, June 6, 2013 8:14:20 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Thank you for your suggestion of using tick data to calculate VWAP instead of the bars on the chart.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.