Calculating Daily VWAP from Intraday Stock Bars
Summary
The document explains volume-weighted average price (VWAP) as an average that gives greater influence to prices recorded with more trading volume. It describes a stock factor calculation that groups intraday bars by instrument and calendar date, then divides the sum of close prices weighted by volume by total volume. This produces one daily value per instrument for analysis of price levels and trading activity.
The example queries a market data source and returns the calculated factor over a requested date range, with a seven-day buffer before filtering results to that range. It demonstrates factor preparation and evaluation workflow, but provides no performance results or evidence that VWAP predicts returns. The code's aggregation uses close multiplied by volume, while its explanatory comment refers to amount divided by volume; these formulations may differ depending on data definitions. The example also does not discuss zero-volume handling, execution benchmarks, or how the factor should be interpreted in a trading strategy.
Key ideas
- VWAP weights prices by trading volume to represent an average market price.
- The example computes a daily value for each instrument by aggregating intraday bars.
- The factor uses the sum of close multiplied by volume divided by total volume.
- A lookback buffer is queried before output is restricted to the requested dates.
- The document gives no backtest or evidence of predictive value.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.