- execution cost vs. market VWAP, baseline schedule
- 5.14 bps
- extra cost on the 50,000-share order
- ≈ $3,371
- SPY trade and quote messages processed
- 2 GB+
The question
This project is about the execution layer, not alpha. A parent order has already been decided upstream; the job is to split it across the session and judge the result against the market's own volume-weighted price. It started as a large-file processing assignment and is growing into a fuller execution research engine.
Approach
- MapReduce-style processing in C++. Multiple mapper threads parse a May 2012 SPY trade-and-quote file of more than 2 GB, with separate modules for CSV parsing, time handling, aggregation, scheduling, VWAP calculation, and output.
- Historical volume profile. Trades from 1–20 May (14 trading days) are bucketed into 15-minute windows; each bucket's average share of daily volume becomes its weight.
- Schedule. The 50,000-share order is split across 27 buckets in proportion to that profile, and executed on 21 May at each bucket's first trade price (the buy-first baseline).
- Benchmark. The schedule's VWAP is compared with the market VWAP over all trades that day.
Results
| My VWAP | 131.210 |
| Market VWAP | 131.142 |
| Difference | 0.0674 (5.14 bps) |
| Market volume on test date | 169,197,102 shares |
For a buy order a higher VWAP means a higher cost, so the baseline paid about 5.14 bps over the benchmark, roughly $3,371 on the order. That number is a cost relative to a benchmark, not a trading profit or loss.
What I learned
- Time conventions matter as much as the model: the raw timestamps are in GMT, New York was on daylight time, and the final 16:00 bucket carries closing-auction and late prints.
- A volume profile tells you how much to trade, not at what price. Executing at the first print of each bucket ignores the price path inside it, which is the obvious place to improve.
Next
Tick-aware and regression-based execution prices, quote-aware simulation with bid/ask imbalance, partial fills with carry-over, and a rolling 20-day multi-day backtest with win rate and dispersion of results.