When I plot VWAP from the Community.Indicators on an intraday chart, I get a value that does not match (does not even come close to matching) the indicator value from other platforms. It seems like the VWAP is being calculated using daily bars. Is there anyway to have the VWAP use intraday bars for its calculation? I've tried searching the forums and the wiki for an answer...no luck. Thanks.
Size:
Color:
I'd say then our version is an approximation. Not every user has access to intraday data (Wealth-Lab Developer does not come with an intraday data feed out of the box). Our VWAP actually uses Daily data (native chart scale to be precise). It follows the Investopedia definition and was documented in the
Wiki more than 4 years ago.
The code is open source for any interested parties to modify it to account for all intraday transaction data for the precise VWAP calculation. It's
Community Indicators, so everyone's welcome.
Size:
Color:
Thanks Eugene for you reply. I was just wondering if there was an easy way to configure the VWAP to us intraday data...I experimented with using SetScaleCompressed and this did not work (obviously). I am just beginning to climb the programming learning curve and I appreciate your help. I opened up the community indicators src and will try to modify it...I will probably have more questions, though. Thanks, again.
Size:
Color:
Where are you going to take
each individual trade that takes place over the defined period of time? (Wikipedia:
VWAP). There's no tick data in Wealth-Lab Pro.
Size:
Color:
I plan to use 1 minute data since I do not have access to a smaller time frame in Wealth-Lab Pro. This should be a fairly close approximation of the VWAP calculated from tick values (at least by noon when I start using VWAP for counter-trend trades). Thoughts?
Size:
Color:
O.K., I took you suggestion Eugene. I really did not know how to write and recompile the formal VWAP indicator, so I used the code to write an informal indicator in the DataSeries format. Good news is that it gives the correct values for intraday VWAP. Bad news is that it takes forever to calculate on larger data sets (I have 8GB ram and an i7...but my resources aren't taxed, so I don't know why the calcs take so long). Also, it plots the zero values and this messes up the y-axis scaling. Here's the code:
CODE:
Please log in to see this code.
I set my initial bar variable to Bars.Count - 1500 to truncate the calculations so the program doesn't freeze, but I would like to place this indicator on a year's worth of data without causing any problems. Any suggestions on how to get it to calculate more quickly? Also, is there any way to avoid plotting the indicator's zero values? Thanks, in advance, for your help.
Size:
Color:
The zeroes are easy to fix:
CODE:
Please log in to see this code.
A cached version (formal indicator) works sufficiently fast. For example, on my PC it's done in less than 4 seconds on a chart of 1-minute Crude Oil with 1.8 million bars (+CL#).
Thanks for the heads-up and code. I'll replace the old VWAP with this intraday-only code in Community Indicators.
Size:
Color:
Thanks Eugene! I had tried to solve the zero problem, but I kept getting errors. Your code works perfect. Incidentally, this also solved the problem with the calculation time. I pulled this up on a year's worth of 1-minute data without a problem. Thanks, again.
a.j.
Size:
Color:
Hi there - Has this intraday VWAP code been added to the community indicators pack yet?
Size:
Color:
Here's a little quest: check out the extension's
change log.
Size:
Color:
Perfect, thanks Eugene. I tried the indicator and it didn't look right, so I thought it had not been incorporated yet. Then I noticed that I wasn't streaming charts and I was a few days off on the data comparison - user error (!!)
Size:
Color:
The current VWAP indicator is using the prior day VWAP closing value for intraday bar zero. Then the summation calc is beginning with the second intraday bar. Consider commenting out these lines to use the full day of trade data:
CODE:
Please log in to see this code.
Size:
Color:
This check is required to avoid a runtime error (index out of bounds) on the first bar of data.
Size:
Color:
When the else statement is removed the check is not needed. Bar zero and intraday bar zero calculate like any other bar with result of average price since volume cancels out in the calculation.
There could be an issue if volume on any bar is misrepresented as zero but that's not addressed in the original or with this suggestion.
Size:
Color:
Indeed, now this makes good sense. After applying the fix I see how the value on the first bar correctly aligns with the price dynamics rather than copying the prior bar's value.
Kevin, I appreciate you taking the effort to submit the fix! We'll factor it in C.Indicators v2018.05. Thanks.
Size:
Color:
You're welcome.
Size:
Color:
I download community indicator and loaded VWAP, but it has only one line, but if I use TD Ameritrade, their ThinkOrSwim has -2, 2.0 parameters, so it actually draw 3 lines(see attached picture). do you have any idea how to make the community indicator same as the ThinkOrSwim?
Size:
Color:
I have no idea what these lines or parameters are on the 3rd party platform. For "our" version please read this thread from the start and refer to the online user guide:
VWAP (Volume Weighted Average Price)
Size:
Color:
To all VWAP users out there.
Community Indicators v2018.05 has been released with KGo's fix for VWAP indicator's potentially incorrect value on intraday bar #0.
Size:
Color: