- Find the average price the stock traded at over the first five-minute period of the day. To do this, add the high, low, and close, then divide by three. Multiply this by the volume for that period. Record the result in a spreadsheet, under column PV.
- Divide PV by the volume for that period. This will give the VWAP value.
- To maintain the VWAP value throughout the day, continue to add the PV value from each period to the prior values. Divide this total by total volume up to that point. To make this easier in a spreadsheet, create columns for cumulative PV and cumulative volume. Both these cumulative values are divided by each other to produce VWAP.
can this be done or am I looking at this wrong?
Should work. You can also use code that is already developed (especially if you want to use well known indicators). No need to invent wheel for a second time.
For example this:
https://github.com/topics/vwap
https://github.com/moremeds/vwap/commit/0e0ffc196c2024ed9cfc26eca4649c83d6795102