Historical Daily VWAP

I am wondering if anyone could suggest a data source that would provide a daily VWAP number. I understand that I can calculate VWAP on my own using intraday data. Would prefer to be able to simply download security info and have VWAP included, for example:

Security, Date, Open, High, Low, Close, Volume, VWAP.

I only need the end-of-day VWAP and only for daily bars. I currently use @NorgateData for my historical data, and do not believe they provide VWAP. Would like to keep my process for getting (and hopefully not having to calculate each day) that historical bit of data as simple as possible.

Note: I am looking for this info on NYSE and NASDAQ stocks and ETFs.

Thanks for any suggestions.

You do not need to calculate it daily. AB will do it for you and it is simple too.

_SECTION_BEGIN( "VWAP" );
	 //Price = ( O + H + L + C ) / 4;
	 //Price = ( H + L + C ) / 3;
	 //Price = ( H + L ) / 2;
	 Price = C;
	 
	 Value = Volume * Price;
	 NewDay = Day() != Ref( Day(), -1 );
	 BarsFromTodayBegin = 1 + BarsSince( NewDay );	 
	 
	 TotalValue = Sum( Value, BarsFromTodayBegin );
	 TotalVolume = Sum( V, BarsFromTodayBegin );
	 
	 VWAP = TotalValue / TotalVolume; 
	 
	 Plot( IIf( NOT NewDay, VWAP, Null ), "VWAP", colorGrey50, styleThick | styleStaircase, Null, Null, 0, -5, 4 );
_SECTION_END();
1 Like

Norgate has Turnover in the Aux1 field. You can divide that by daily Volume to get a VWAP estimate.

2 Likes

@QEdges there is a data feed that I believe provides VWAP (I assume you will need to subscribe) though I don't know of any AmiBroker users using this, https://www.xignite.com/Product/vwap-data#/productoverview

If you stay with Norgate and use your data to calculate VWAP, don't forget that if you have historically adjusted data for splits and dividends may skew your calculations, see AmiBroker > File > Database Settings > Configure
image

In this case you may need to use Norgate special functions to reference the original unadjusted closing price and unadjusted volume.

oc = NorgateOriginalCloseTimeSeries();

ov = NorgateOriginalVolumeTimeSeries();

And though not directly related to your question, there was an interesting discussion on this forum on creating an "anchored VWAP"

2 Likes

Thanks all. Based on what I am seeing the @NorgateData solution does not appear feasible. Conceptually, it is great. But I am seeing too many inconsistencies in the "Turnover" data to be able to rely on it. I am surprised by this, because Norgate seems to be very good with all their other data. But unless I am missing something, Turnover (Aux1) appears off. The charts below show Turnover in the yellow line on the bottom. The green line that goes with the price bars is a VWAP estimate that = aux1/volume. They are of SPY, but I found the same kind of issues when looking at DIA, AAPL, and anything of the sample I tried.

image

image

For me, the inconsistencies here make the "Turnover" data essentially worthless. Perhaps it is just a temporary issue that @NorgateData will be able to fix. But for the time being, it appears that for someone calculate a reasonable end of day VWAP, that person will need to use a database that includes intraday data.

We'll investigate the issue here - the turnover should never be zero unless there's no trading on that date.

1 Like

The erroneous values in the turnover field (in Aux1, for stocks) has been fixed. Users will need to shut down AmiBroker, run an update in NDU and start AmiBroker again.

A further comment about VWAP.

There are actually VWAPs in play. There are many factors involved in coming up with a VWAP.

Here's a sample of a few of the different factors in play:

  • Pre- and post- market trading vs regular trading hours
  • Multiple exchanges/ECNs (including dark pools) vs primary exchange
  • Standard trades vs those that incorporate some of the following: non-standard trades such as block trades, odd-lot trades, late-reported trades
  • Feeds that are revised due to cancelled trades vs those that take all trades (and ignore cancellations/busted trades)

If your data provider gives you VWAP - ask them for detail about how it's produced.

2 Likes

Thanks @NorgateData for the quick turnaround. The Turnover data looks much better upon quick inspection! Good points about VWAP measurements as well.