Fading the VWAP bands on the S&P 500
Micro E-mini S&P 500 (MES) · 5-minute bars · 2016 to 2026 · Mean reversion · Widely taught; VWAP itself is an execution benchmark
No edge after costs: profit factor 0.68 out of sample.
- Profit factor, out of sample
- 0.68
- Average trade, out of sample
- −0.26R
- Win rate, out of sample
- 28%
- Trades, 10 years
- 4,784
- Max drawdown
- $390,750
- Pass odds, median plan
- 2.2%
Hypothetical results. These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
Abstract
We backtested the VWAP mean reversion rules on Micro E-mini S&P 500 (MES) 5-minute bars from 2016-01-11 to 2026-10-30: 4,784 trades, with commission and a tick of slippage on every market and stop fill. In sample (to 2023-08-03) it made −0.34R per trade with a profit factor of 0.62; out of sample (from 2023-08-04) −0.26R per trade and 0.68 over 1,431 trades. 2 of the 25 parameter settings we tried were profitable out of sample. Sized at $250 of risk a trade, simulated 50K evaluations passed 1% to 3% of the time across 36 tracked plans.
1Hypothesis
When price closes more than two standard deviations away from the day's VWAP, bet on a return to VWAP. The stop is one more standard deviation away.
If intraday stretches away from VWAP are mostly order-flow noise, a close beyond the 2-sigma band should revert to VWAP more often than it runs one more sigma, enough to pay for costs.
2Data
- Instrument
- Micro E-mini S&P 500 (MES), traded on the ES price series (ES.c.0: front month, rolled on the calendar). CME Globex via Databento.
- Period
- 2016-01-11 to 2026-10-30: 2,746 sessions, 1,056,820 one-minute bars, built into 210,816 5-minute bars of the regular session (09:30 to 16:00 ET).
- Costs
- $0.75 commission a contract each way and 1 tick ($1.25) of slippage on every market and stop fill. Limit orders fill when price touches them; market orders fill at the next bar's open and stops at their price, each with one tick of slippage; when a bar touches both the stop and the target, the stop counts.
- Position size
- About $250 of risk a trade: micro contracts, rounded down, at least one. R is a trade's net P&L divided by its risk at entry.
- Out of sample
- The last 30% of weekdays: 2023-08-04 on (846 days), after 1,974 in-sample days. The rules were fixed before either side was run.
3Method
Our reading of the publicly described rules; the creator may trade it differently. The rules, exactly as the code runs them:
- VWAP and its bands restart at 09:30 ET. VWAP is the volume-weighted average of each 5-minute bar's typical price (high + low + close) / 3; sigma is the volume-weighted standard deviation of the same prices around it.
- Entry: a 5-minute bar that CLOSES below VWAP - band_sd (2) sigma buys at the next bar's open; one that closes above VWAP + 2 sigma sells. Signals only from 10:00 to 15:00 ET, so the bands have half an hour of data first.
- Stop: stop_sd (1) sigma beyond the signal bar's close.
- Target: VWAP as it stood at the signal.
- Exit: the stop, the target, or flat at 15:55 ET. At most max_trades_per_day (2) trades a day, one at a time.
- Size: about risk_usd dollars of risk a trade (micro contracts, rounded down, at least 1 and at most max_contracts).
"""VWAP mean reversion with standard-deviation bands, on MES 5-minute bars, regular session. Our reading of the commonly taught rules; traders who teach it may trade it differently. Rules: 1. VWAP and its bands restart at 09:30 ET. VWAP is the volume-weighted average of each 5-minute bar's typical price (high + low + close) / 3; sigma is the volume-weighted standard deviation of the same prices around it. 2. Entry: a 5-minute bar that CLOSES below VWAP - `band_sd` (2) sigma buys at the next bar's open; one that closes above VWAP + 2 sigma sells. Signals only from 10:00 to 15:00 ET, so the bands have half an hour of data first. 3. Stop: `stop_sd` (1) sigma beyond the signal bar's close. 4. Target: VWAP as it stood at the signal. 5. Exit: the stop, the target, or flat at 15:55 ET. At most `max_trades_per_day` (2) trades a day, one at a time. 6. Size: about `risk_usd` dollars of risk a trade (micro contracts, rounded down, at least 1 and at most `max_contracts`)."""import math import qy class Bot(qy.Strategy): """Fade a close outside the 2-sigma VWAP band, target VWAP.""" symbol = "MES" timeframe = "5m" session = "rth" params = {"band_sd": 2.0, "stop_sd": 1.0, "max_trades_per_day": 2, "risk_usd": 250, "max_contracts": 50} max_position = 50 entry_window = ("10:00", "15:00") flatten_time = "15:55" overnight = False def setup(self): self.day = None def _size(self, risk_points): per_contract = risk_points * self.point_value n = int(self.p.risk_usd // per_contract) if per_contract > 0 else 1 return max(1, min(self.p.max_contracts, n)) def on_bar(self, bar): if self.day != bar.date: self.day = bar.date self.sv = self.svp = self.svp2 = 0.0 self.open_px = bar.open tp = (bar.high + bar.low + bar.close) / 3 v = bar.volume or 0.0 self.sv += v self.svp += v * tp self.svp2 += v * tp * tp if self.sv <= 0: return vwap = self.svp / self.sv sigma = math.sqrt(max(0.0, self.svp2 / self.sv - vwap * vwap)) if sigma < self.tick_size or not self.position.is_flat or self.orders: return signal_at = bar.dt.hour * 60 + bar.dt.minute + 5 # the bar's close, when the order goes in if self.trades_today >= self.p.max_trades_per_day or not 600 <= signal_at < 900: return close = bar.close stretch = (close - vwap) / sigma move_pct = abs(close - self.open_px) / self.open_px * 100 risk = self.p.stop_sd * sigma if stretch <= -self.p.band_sd: self.buy(self._size(risk), stop_price=close - risk, target_price=vwap, tag=f"VWAP fade long | f={move_pct:.4f}") elif stretch >= self.p.band_sd: self.sell(self._size(risk), stop_price=close + risk, target_price=vwap, tag=f"VWAP fade short | f={move_pct:.4f}")4Results
| Statistic | In sample | Out of sample | All |
|---|---|---|---|
| Trades | 3,353 | 1,431 | 4,784 |
| Net P&L | −$293,050 | −$96,318 | −$389,368 |
| Profit factor | 0.62 | 0.68 | 0.63 |
| Average trade | −0.34R | −0.26R | −0.31R |
| 95% interval of the average | −0.39 to −0.29 | −0.34 to −0.19 | −0.36 to −0.27 |
| t-statistic of trade R | −13.60 | −6.83 | −15.12 |
| Win rate | 30% | 28% | 29% |
| Average win / average loss | 1.45 | 1.72 | 1.53 |
| Max drawdown | $293,505 | $97,490 | $390,750 |
| Sharpe ratio (daily, annualized) | −4.98 | −3.88 | −4.65 |
| Longest losing streak | 22 | 16 | 22 |
| Long / short profit factor | 0.67 / 0.57 | 0.76 / 0.61 | 0.69 / 0.58 |
| Average holding time | 29 min | 27 min | 28 min |
| Commission paid | $119,523 | $30,017 | $149,540 |
Drag across the chart to zoom into a period, double-click to reset.
Averages: −0.34R in sample, −0.26R out of sample.
1,600 of 4,746 points drawn; the fit and the means use all of them. Drag a box to zoom, double-click to reset.
5Robustness
We reran the strategy on a grid of 25 settings of its two main parameters, each on the full history with the same split. 1 were profitable in sample and 2 out of sample.
Entry band (sigma) across, stop beyond the close (sigma) up. Solid outline: the defaults we tested; dashed: the in-sample best.
Hover a cell for both sides of the split.
Entry band (sigma) 1.50 to 3.50 across · Stop beyond the close (sigma) 0.50 to 2.00 in depth · Profit factor, out of sample 0.53 to 1.12 as height and shade. Drag or use the arrow keys to turn it.
Drag to rotate; ctrl or ⌘ and scroll to zoom.
What would change it
Nothing on the grid clearly helps. Its in-sample best, entry band (sigma) 3.5 and stop beyond the close (sigma) 2, did better out of sample, profit factor 1.12 against 0.68 for the defaults, but over only 35 trades, t = 0.5: too few, or too noisy, to call it a fix.
6Prop-firm implications
The backtest's sessions run through the rules of 36 tracked 50K evaluations: 2,000 runs of up to 60 sessions each, with the drawdown and daily limits checked against each trade's intraday low. Intervals are Wilson 95% intervals of the simulation. A simulation of the past, not the chance that anyone passes.
| Plan | Pass odds, 95% interval | Pass | Fail | Out of time | Median sessions |
|---|---|---|---|---|---|
| AquaFutures Beginner 50K Evaluation | 2.5% | 97% | 0.1% | 12 | |
| Bulenox 50K Qualification Account (Legacy, Option 2, EOD drawdown) | 2.5% | 97% | 0.1% | 12 | |
| Bulenox 50K Qualification Account (Legacy, Option 1, trailing drawdown) | 2.4% | 98% | 0% | 11.5 | |
| Alpha Futures Standard 50K Evaluation | 2.2% | 98% | 0% | 11 | |
| Alpha Futures Zero 50K Evaluation | 2.2% | 98% | 0% | 11 | |
| Apex Trader Funding 50K EOD Evaluation | 2.2% | 98% | 0% | 11 | |
| Elite Trader Funding 50K End of Day Drawdown Evaluation | 2.2% | 98% | 0% | 11 | |
| FTMO Futures Pro 50K Evaluation | 2.2% | 98% | 0% | 11 | |
| Funded Futures Family 50K Evaluation (standard plan) | 2.2% | 98% | 0% | 11 | |
| Funded Futures Network STEADY 50K Evaluation | 2.2% | 98% | 0% | 11 |
7Limitations
- Bands are built from 5-minute bars, not ticks.
- Mean reversion loses on trend days, and the stop's distance moves with the day's volatility.
- One market (MES).
- A backtest on the past, with fills simulated from one-minute bars; live fills, queues and outages differ.
8Conclusion
No edge after costs: profit factor 0.68 out of sample. Nothing on the grid clearly helps. Its in-sample best, entry band (sigma) 3.5 and stop beyond the close (sigma) 2, did better out of sample, profit factor 1.12 against 0.68 for the defaults, but over only 35 trades, t = 0.5: too few, or too noisy, to call it a fix. On this reading of the rules, with these costs, the historical record gives no reason to expect a profit.
9References
- Berkowitz, S. A., Logue, D. E., and Noser, E. A. (1988). The Total Cost of Transactions on the NYSE. Journal of Finance, 43(1), 97-112.