Trading pullbacks with the VWAP trend
Micro E-mini Nasdaq-100 (MNQ) · 5-minute bars · 2016 to 2026 · Momentum
No edge after costs: profit factor 0.87 out of sample.
- Profit factor, out of sample
- 0.87
- Average trade, out of sample
- −0.09R
- Win rate, out of sample
- 33%
- Trades, 10 years
- 5,070
- Max drawdown
- $147,488
- Pass odds, median plan
- 9.8%
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 trend pullback rules on Micro E-mini Nasdaq-100 (MNQ) 5-minute bars from 2016-01-11 to 2026-10-30: 5,070 trades, with commission and a tick of slippage on every market and stop fill. In sample (to 2023-08-03) it made −0.14R per trade with a profit factor of 0.83; out of sample (from 2023-08-04) −0.09R per trade and 0.87 over 1,509 trades. 0 of the 16 parameter settings we tried were profitable out of sample. Sized at $250 of risk a trade, simulated 50K evaluations passed 5% to 12% of the time across 36 tracked plans.
1Hypothesis
While price and its 20-bar EMA hold above VWAP, buy a bar that dips to the EMA and closes above it; the mirror image short.
If the side of VWAP marks the day's trend, buying dips to the EMA in an uptrend should reach twice the risk more often than one time in three.
2Data
- Instrument
- Micro E-mini Nasdaq-100 (MNQ), traded on the NQ price series (NQ.c.0: front month, rolled on the calendar). CME Globex via Databento.
- Period
- 2016-01-11 to 2026-10-30: 2,745 sessions, 1,056,797 one-minute bars, built into 210,814 5-minute bars of the regular session (09:30 to 16:00 ET).
- Costs
- $0.75 commission a contract each way and 1 tick ($0.50) 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:
- The trend is up while the close and the ema_len (20) bar EMA are both above the session VWAP (restarted at 09:30 ET), down while both are below it.
- Entry: in an uptrend, a bar whose low touches the EMA and whose close holds above it buys at the next bar's open; the mirror image sells in a downtrend. Signals from 10:00 to 15:00 ET.
- Stop: one tick beyond the signal bar's extreme (its low for a long).
- Target: target_r (2) times the risk.
- Exit: the stop, the target, or flat at 15:55 ET. At most 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 trend pullback on Micro E-mini Nasdaq-100 (MNQ) 5-minute bars, regular session. Rules: 1. The trend is up while the close and the `ema_len` (20) bar EMA are both above the session VWAP (restarted at 09:30 ET), down while both are below it. 2. Entry: in an uptrend, a bar whose low touches the EMA and whose close holds above it buys at the next bar's open; the mirror image sells in a downtrend. Signals from 10:00 to 15:00 ET. 3. Stop: one tick beyond the signal bar's extreme (its low for a long). 4. Target: `target_r` (2) times the risk. 5. Exit: the stop, the target, or flat at 15:55 ET. At most 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 qy def ready(*values): """True when every value is a number (indicators have no value until they have enough data).""" return all(v is not None and v == v for v in values) class Bot(qy.Strategy): """Buy pullbacks to the EMA while price holds above VWAP, sell them below.""" symbol = "MNQ" timeframe = "5m" session = "rth" params = {"ema_len": 20, "target_r": 2.0, "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.ema_line = self.ema(self.close, self.p.ema_len) self.vw = self.vwap(reset="09:30") 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): e, v = self.ema_line[0], self.vw[0] t = bar.dt.hour * 60 + bar.dt.minute + 5 if not ready(e, v) or not self.position.is_flat or self.orders or self.trades_today >= 2 or not 600 <= t < 900: return tick = self.tick_size f = abs(bar.close - v) / bar.close * 100 if bar.close > v and e > v and bar.low <= e < bar.close: stop = bar.low - tick self.buy(self._size(bar.close - stop), stop_price=stop, target_r=self.p.target_r, tag=f"Pullback long | f={f:.4f}") elif bar.close < v and e < v and bar.high >= e > bar.close: stop = bar.high + tick self.sell(self._size(stop - bar.close), stop_price=stop, target_r=self.p.target_r, tag=f"Pullback short | f={f:.4f}")4Results
| Statistic | In sample | Out of sample | All |
|---|---|---|---|
| Trades | 3,561 | 1,509 | 5,070 |
| Net P&L | −$106,611 | −$32,527 | −$139,138 |
| Profit factor | 0.83 | 0.87 | 0.84 |
| Average trade | −0.14R | −0.09R | −0.12R |
| 95% interval of the average | −0.19 to −0.09 | −0.16 to −0.02 | −0.16 to −0.08 |
| t-statistic of trade R | −5.70 | −2.46 | −6.14 |
| Win rate | 34% | 33% | 34% |
| Average win / average loss | 1.60 | 1.75 | 1.64 |
| Max drawdown | $113,015 | $35,457 | $147,488 |
| Sharpe ratio (daily, annualized) | −1.88 | −1.50 | −1.77 |
| Longest losing streak | 26 | 13 | 26 |
| Long / short profit factor | 0.83 / 0.84 | 0.88 / 0.85 | 0.84 / 0.84 |
| Average holding time | 35 min | 38 min | 36 min |
| Commission paid | $96,947 | $16,772 | $113,718 |
Drag across the chart to zoom into a period, double-click to reset.
Averages: −0.14R in sample, −0.09R out of sample.
1,600 of 5,070 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 16 settings of its two main parameters, each on the full history with the same split. 0 were profitable in sample and 0 out of sample.
EMA length (bars) across, target (R) up. Solid outline: the defaults we tested; dashed: the in-sample best.
Hover a cell for both sides of the split.
EMA length (bars) 10.0 to 50.0 across · Target (R) 1.00 to 3.00 in depth · Profit factor, out of sample 0.76 to 0.93 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 helps. Its in-sample best, EMA length (bars) 20 and target (R) 3, had profit factor 0.86 in sample but 0.89 out of sample, against 0.87 for the defaults.
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 | 11.5% | 86% | 2% | 22.5 | |
| Bulenox 50K Qualification Account (Legacy, Option 2, EOD drawdown) | 11.5% | 86% | 2% | 22.5 | |
| FundedNext Futures Flex Challenge 50K | 10.7% | 89% | 0% | 15 | |
| Bulenox 50K Qualification Account (Legacy, Option 1, trailing drawdown) | 10.5% | 88% | 1% | 21 | |
| Alpha Futures Zero 50K Evaluation | 9.9% | 89% | 0.9% | 21 | |
| Apex Trader Funding 50K EOD Evaluation | 9.9% | 89% | 0.9% | 21 | |
| Topstep 50K Trading Combine | 9.9% | 89% | 0.9% | 21 | |
| Alpha Futures Standard 50K Evaluation | 9.8% | 89% | 0.9% | 21 | |
| Elite Trader Funding 50K End of Day Drawdown Evaluation | 9.8% | 89% | 0.9% | 21 | |
| FTMO Futures Growth 50K Evaluation | 9.8% | 89% | 0.9% | 21 |
7Limitations
- At most two trades a day.
- One market (MNQ).
- 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.87 out of sample. Nothing on the grid helps. Its in-sample best, EMA length (bars) 20 and target (R) 3, had profit factor 0.86 in sample but 0.89 out of sample, against 0.87 for the defaults. On this reading of the rules, with these costs, the historical record gives no reason to expect a profit.