General Topics
Markets
Technical Topics
Brokerage Firms
Company Specific
Community Lounge
Site Support

# Anyone know how to calculate SD of VWAP?

Discussion in 'Technical Analysis' started by IronFist, Jul 23, 2008.

1. ### Xuanxue

Sadly, the only way we traders can possibly VWAP algorithm trade timed with the markets reliably without relying on brokers, or any two-bit coder that could, is to reverse engineer VWAP code offered by NASDAQ or Bloomberg, program a real-time subroutine in excel using Visual Basic.NET and transfering the data to charting software via a third-party program. Or, which is likely cost and time efficient, hire a programmer to do it for you.

http://www.excel-modeling.com/index_007.htm
http://msdn.microsoft.com/en-us/library/aa140061(office.10).aspx
https://data.nasdaq.com/VWAP.aspx
https://www.dnbnor.no/portalfront/nedlast/no/markets/aksjerapporter/Bloomberg_Algorithm_VWAP.pdf
http://www.willowsolutions.com/tips/tips_2001_01_2.shtml
http://www.tssupport.com/services/owndata/

#31     Jul 25, 2008
2. ### IronFist

Here. I'll attach a 15 min chart of a few days in this post, and a 1500 constant volume chart of a few days in the next post.

• ###### ym 15 min chart vwap.gif
File size:
35.4 KB
Views:
275
#32     Jul 25, 2008
3. ### IronFist

Reversion to mean traders would have been DESTROYED yesterday (7/24).

• ###### ym 1500 constant vol vwap.gif
File size:
31.4 KB
Views:
301
#33     Jul 25, 2008

Ok. Now that I am seeing the entire windows, I would agree that looks correct. Notice the VWAP remained relatively constant after regular trading hours as I expected. What caused the huge gap (between price and VWAP), however, was the huge gap in price after the closing periods. So your original argument about volume as well as the mathematical argument I made both fit in under this context. I just needed to see more of the picture to confirm that.

Can you plot the a similar output (several full windows) with the Stdev bands (say +/- 3) you have calculated that you said do not look right?

BTW. Can you also include some type of table with your first few (20 or so) avg prices (closing or whatever they use to calculate vwap per pt), corresponding VWAP values, and stdev calculation that you are applying with respect to these variables?

#34     Jul 25, 2008
5. ### IronFist

wat?

Why can't I just use the VWAP indicator in my charting package?

#35     Jul 25, 2008
6. ### IronFist

I'm not entirely sure what they use. If I can find this info out I can plot it in a study. Otherwise you'll just get pics of that other stuff you asked for.

#36     Jul 25, 2008

start with the pics (windows of VWAP and +/-3 stdev bands over several full periods). I'd prefer the actual data pts. and calculation they use to get stdev (you can't plot this). Although, if you can't look under the hood (at how they calculate stdev) and make some mods, it's going to be kind of hard to troubleshoot the problem and fix it, while relying on their platform. We can at least look at the visual plot and make some inferences about whether it looks to be calculated erroneously or not.

#37     Jul 25, 2008
8. ### IronFist

The STDEV calculation they use is the normal one.

I coded it myself and got the same values a I did when I used the built-in SD function.

I'll give you a huge chart using SDs of the VWAP but it won't really be noticable because they hug the VWAP so tightly.

Hang on. Hopefully ET will allow that large of an attachment.

#38     Jul 25, 2008

I don't understand. If you were able to calculate/code stdev function, you should at least be able to describe how it is being applied to the data.

Did you just do stdev of VWAP data alone? That makes no sense. I think I might already know the problem, but let's see the plot.

As I mentioned earlier, if you only calculated stdev based on VWAP data, that would be incorrect, as the dispersion you measure would be how each VWAP pt. varied relative to the running absolute mean of the sample set of VWAP only.

You don't want that. You want to measure stdev as a function of two variables, VWAP and Price.
What you want to see is a measure of dispersion about how far price deviates from VWAP over time.

It also has to be updated at each step..
Meaning the stdev value will change at each step, along with cumulative vwap and vol changes.

#39     Jul 25, 2008
10. ### IronFist

So it needs to calculate the difference between price and VWAP over x number of periods?

#40     Jul 25, 2008
ET IS FREE FOR TRADERS BECAUSE OF THE FINANCIAL SUPPORT FROM THESE SPONSORS: