DYO: VWAP Volume Weighted Average Price
|
Q: Is there any way to plot the VWAP (Volume Weighted Average Price) on a chart in Ensign? VWAP is calculated by adding the dollars traded for every trade (Price x Shares), divided by the number of shares traded during the whole day.
My friend suggested that you may be able to "translate" the code used in Tradestation, I know you guys have nothing to do with Tradestation, but as they have the code maybe you can convert it to add the VWAP availability in Ensign. I am attaching a page which contains the code and I would appreciate your letting me know whether anyone at Ensign can use this to plot the VWAP in Ensign.
A: Thanks for including the TS code reference so I could see the logic of their implementation. Here is our implementation using our Design Your Own study.
Lines A, B and C will reset the Price accumulator in GV[248] and the Volume accumulator in GV[249] at the start of each day.
Line D will get an average price for this bar by dividing by 4 the sum of the open, high, low and last prices.
Line E multiplies the average price by the bar's volume.
Line F adds the volume weighted price to the price accumulator in GV[248].
Line G adds the volume to the volume accumulator in GV[249].
Line H plots the VWAP which is the sum of the weighted price divided by the sum of the volume.
Have the Close Only option checked so the study updates at the completion of the current bar being built in real-time.
Template: 1358-VWAP
Q: I have the vwap dyo from the ensign website, I just wanted to let you know it disappeared off my chart around 1:30 mst today. Not all the bars only the last 10 or so on a 3 minute es #f chart. Weird. I just did a refresh and the indicator came back on the whole chart. Included is the DYO with the problem.
A: The template is a CLOSE ONLY design that is summing volume one time per bar. You have the Close Only option on the DYO unchecked and that is the source of your problem. Solution is to recheck the Close Only box.
Last modified 8/8/08 2:08 PM
|