How to use the VWAP and TWAP calculator
The page has three tools.
VWAP. Enter the market’s bars (a time label, the typical price of the bar and its volume), for example 30-minute or 5-minute bars from your trading platform. Choose Market bars and my fills to add your own executions (time, price and shares) and the side of your order; the calculator then compares your average price with the VWAP.
TWAP. Enter the order quantity, the start and end times in minutes after the 9:30 ET open, and the slice interval. Optionally paste one price per interval to get the TWAP of those prices and, with exactly one price per slice, the average price of the schedule.
Execution benchmark. Enter the side, the arrival price, your average fill, the shares filled and the fees. The interval VWAP and any unfilled shares are optional.
The formulas
TWAP = (P1 + P2 + … + Pn) ÷ nPi is the price of bar or trade i and Vi its volume. Your own average fill price is the same weighted average over your fills, weighted by shares filled.
The TWAP schedule keeps the cumulative quantity proportional to elapsed time. The target at the end of slice k is Q × (tk − start) ÷ (end − start), rounded to whole shares, and each child order is the difference between successive targets. The children always add up to the order exactly, and a shorter final slice gets proportionally fewer shares.
Implementation shortfall, a measure introduced by André Perold in 1988, compares the real trade with a paper trade of the full intended quantity at the arrival price:
Shortfall (bps) = Shortfall ÷ (intended shares × arrival) × 10,000Pend is the price when the unfilled remainder was cancelled. The three terms are the execution cost, the explicit fees and the opportunity cost.
A worked example
VWAP. The example session of a fictional stock has 13 half-hour bars and 2,800,000 shares of volume. The VWAP is $50.2631 and the TWAP of the bars is $50.2562. A buy order of 15,000 shares filled in five pieces at an average of $50.2730: +2.0 bps against VWAP, a cost of $148.39. The order was 0.54% of the day’s volume, small enough not to distort the benchmark.
TWAP. Working 20,000 shares over the whole session (0 min to 390 min after the open) in slices of 30 minutes gives 13 child orders of 1,538 to 1,539 shares, a constant 51.3 shares a minute. With one price per slice, the schedule’s average price is $50.2546, practically the plain TWAP of $50.2546, because every slice is almost the same size.
Implementation shortfall. You decided to buy at an arrival price of $50 and filled 10,000 shares at an average of $50.08, paying $30 in fees. The shortfall is +16.6 bps, $830.00. The interval VWAP of $50.05 splits the price cost into +10.0 bps of market drift from arrival to VWAP and +6.0 bps of execution against VWAP.
VWAP, TWAP or arrival price?
| Benchmark | What it measures | Suits | Weakness |
|---|---|---|---|
| VWAP | Your price against the average share traded | Orders that follow the market’s volume over a day | Large orders move the VWAP themselves; ignores drift before you started |
| TWAP | Your price against the average over time | Thin or erratic volume, or when the volume profile is unknown | Trades too much in quiet periods and too little in busy ones |
| Arrival price | The full cost of turning a decision into a position | Alpha-driven trades where the price may run away | Noisy: market drift dominates on single orders |
VWAP is one of the most common benchmarks for agency execution because it is easy to compute. Its weakness is that it shares the market’s direction: if prices rise all day, a buyer can beat VWAP and still pay far more than the price at the moment of the decision. Arrival price captures that cost, which is why portfolio managers who trade on short-lived signals prefer implementation shortfall. The example shows the gap: execution against VWAP cost only +6.0 bps, while drift during the order cost +10.0 bps.
Common mistakes
- Using the whole-day VWAP for an order that worked only part of the day. Compare with the VWAP of the interval when you were trading, or the benchmark rewards or punishes moves you did not take part in.
- Ignoring your own share of volume. When your fills are a large part of the market volume, they pull the VWAP toward your price and make the result look better than it was. The calculator warns above 20%.
- Leaving out unfilled shares. If a buy order was cancelled because the price ran away, the missed shares are a real cost. With 2,000 shares unfilled and the price at $50.30 on cancellation, the example shortfall rises from +16.6 bps to +23.8 bps.
- Judging a single order. Shortfall on one order is dominated by random market moves; average it over many orders before judging a broker or algorithm.
- Rounding TWAP slices carelessly. Rounding every child order down leaves shares unexecuted at the end; rounding the cumulative target, as here, keeps the schedule exact. With 25,000 shares over 14 slices of 20 minutes, most children are 1,852 shares and the shorter last slice gets 926.
What this calculator does not include
- Bar prices are approximations. A bar’s typical price stands in for all the trades inside it; the true VWAP uses every trade. Finer bars give a closer figure.
- No volume forecast. A real VWAP algorithm predicts the day’s volume curve; this page measures the VWAP after the fact. To estimate costs before trading, use the market impact calculator.
- Times are minutes after a 9:30 ET open on a regular US session; early closes and other markets need their own offsets.
- Delay cost between the investment decision and the order’s arrival at the desk is not separated; enter the decision price as the arrival price to include it.