Skip to content

VWAP reversion on gold

Micro Gold (MGC) · 5-minute bars · 2016 to 2026 · Mean reversion

No edge after costs: profit factor 0.68 out of sample.

Profit factor, out of sample
0.68
Average trade, out of sample
−0.24R
Win rate, out of sample
29%
Trades, 10 years
4,211
Max drawdown
$336,257
Pass odds, median plan
1.3%

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 gold VWAP reversion rules on Micro Gold (MGC) 5-minute bars from 2016-01-11 to 2026-10-30: 4,211 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.60; out of sample (from 2023-08-04) −0.24R per trade and 0.68 over 1,320 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 0% to 2% of the time across 36 tracked plans.

1Hypothesis

The S&P 500 VWAP-band fade, moved to gold's day session: fade a close two standard deviations from VWAP, target VWAP.

If gold's intraday stretches from VWAP are order-flow noise like the index's, the same band fade should revert to VWAP often enough to pay.

2Data

Instrument
Micro Gold (MGC), traded on the GC price series (GC.v.0: the most traded contract, rolled on volume). CME Globex via Databento.
Period
2016-01-11 to 2026-10-30: 2,791 sessions, 3,771,561 one-minute bars, built into 761,875 5-minute bars around the clock.
Costs
$0.75 commission a contract each way and 1 tick ($1.00) 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:

  1. VWAP and its bands restart at 08:20 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 from 09:00 to 13:00 ET.
  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 13:30 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).
bot.py, the file the engine ran
"""VWAP mean reversion on Micro Gold (MGC) 5-minute bars, from the 08:20 ET COMEX open. The same band rule as the S&P 500 VWAP paper, moved to gold's own day session. Rules:  1. VWAP and its bands restart at 08:20 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 from 09:00 to 13:00 ET.  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 13:30 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 math import qy  class Bot(qy.Strategy):    """Fade a close outside gold's 2-sigma VWAP band, target VWAP."""     symbol = "MGC"    timeframe = "5m"    session = None    params = {"band_sd": 2.0, "stop_sd": 1.0, "risk_usd": 250, "max_contracts": 50}    max_position = 50    entry_window = ("09:00", "13:00")    flatten_time = "13:30"    overnight = False     def setup(self):        self.active = 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):        start = bar.dt.hour * 60 + bar.dt.minute        if not 500 <= start < 810:            return        if self.active != bar.date:            self.active = 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))        t = start + 5        if sigma < self.tick_size or not self.position.is_flat or self.orders or self.trades_today >= 2 or not 540 <= t < 780:            return        close = bar.close        move = abs(close - self.open_px) / self.open_px * 100        risk = self.p.stop_sd * sigma        stretch = (close - vwap) / sigma        if stretch <= -self.p.band_sd:            self.buy(self._size(risk), stop_price=close - risk, target_price=vwap, tag=f"Gold VWAP fade long | f={move:.4f}")        elif stretch >= self.p.band_sd:            self.sell(self._size(risk), stop_price=close + risk, target_price=vwap, tag=f"Gold VWAP fade short | f={move:.4f}")

4Results

Table 1. In sample (2016-01-11 to 2023-08-03) against out of sample (2023-08-04 to 2026-10-30), after costs.
StatisticIn sampleOut of sampleAll
Trades2,8911,3204,211
Net P&L−$253,727−$81,159−$334,886
Profit factor0.600.680.62
Average trade−0.34R−0.24R−0.31R
95% interval of the average−0.39 to −0.29−0.31 to −0.16−0.35 to −0.27
t-statistic of trade R−13.16−6.19−14.36
Win rate30%29%30%
Average win / average loss1.371.671.46
Max drawdown$255,035$82,720$336,257
Sharpe ratio (daily, annualized)−5.06−3.89−4.71
Longest losing streak191819
Long / short profit factor0.58 / 0.620.65 / 0.700.60 / 0.65
Average holding time24 min23 min24 min
Commission paid$102,546$21,698$124,244
Cumulative P&LDrawdown from the highOut of sample from 2023-08-04

Drag across the chart to zoom into a period, double-click to reset.

Figure 1. Cumulative P&L after costs and its drawdown from the running high, 2016-01-11 to 2026-10-30, at about $250 of risk a trade. The shaded part is out of sample.
In sample (2,891 trades)Out of sample (1,320)Averages

Averages: −0.34R in sample, −0.24R out of sample.

Figure 2. The distribution of trade results in R, as a share of each side's trades. Bars are in sample; the line is out of sample.
In sampleOut of sampleQuintile mean, 95% intervalOLS fitDensity contours

1,600 of 4,176 points drawn; the fit and the means use all of them. Drag a box to zoom, double-click to reset.

Figure 3. Trade R against how far gold had moved from its open, log x-axis; the dashed line is the OLS fit (r = 0.06, p < 0.001, n = 4,176; Spearman ρ = 0.29). Out of sample alone: r = 0.08, p = 0.003. Squares are the means of five equal-count bins, with 95% intervals.

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.

2
0.73
0.73
0.72
0.65
1.5
0.72
0.74
0.69
0.72
1
0.66
0.68
0.70
0.92
0.50
0.64
0.62
0.58
0.73
1.5
2
2.5
3

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.00 across · Stop beyond the close (sigma) 0.50 to 2.00 in depth · Profit factor, out of sample 0.58 to 0.92 as height and shade. Drag or use the arrow keys to turn it.

Drag to rotate; ctrl or ⌘ and scroll to zoom.

Figure 4. Profit factor across entry band (sigma) and stop beyond the close (sigma), as a map and as a surface of the same grid. Values above 4 are drawn at 4.

What would change it

Nothing on the grid helps. Its in-sample best, entry band (sigma) 3 and stop beyond the close (sigma) 2, had profit factor 0.76 in sample but 0.65 out of sample, against 0.68 for the defaults.

In-sample yearOut-of-sample year95% interval
Figure 5. Average trade by calendar year with its 95% interval: a year-by-year walk through the history. Lighter bars are in-sample years.
Figure 6. Average trade in three volatility regimes: terciles of the 20-session average of the daily range (% of the open), up to the day before the trade (full session). The cut-offs use the whole period, so this describes, it doesn't forecast.
Figure 7. Average trade by weekday and by the hour of entry (New York time), with 95% intervals.
Median25th to 75th percentile5th and 95thRuin: down $2,000
Figure 8. 2,000 simulated years of 252 sessions, drawn session by session from the whole backtest (days without trades included), with 48 paths drawn; red paths lost $2,000 at some point. Risk of ruin 100.0% [99.8%, 100.0%]; 0% of years ended up; median ending P&L −$30,549, 5th to 95th percentile −$41,589 to −$18,600.

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.

PlanPass odds, 95% intervalPassFailOut of timeMedian sessions
FundedNext Futures Flex Challenge 50K1.8%98%0%12
AquaFutures Beginner 50K Evaluation1.4%98%0.5%16
Bulenox 50K Qualification Account (Legacy, Option 1, trailing drawdown)1.4%98%0.3%16
Bulenox 50K Qualification Account (Legacy, Option 2, EOD drawdown)1.4%98%0.5%16
Alpha Futures Standard 50K Evaluation1.3%99%0.1%15.5
Alpha Futures Zero 50K Evaluation1.3%99%0.1%15.5
Apex Trader Funding 50K EOD Evaluation1.3%99%0.1%15.5
Elite Trader Funding 50K End of Day Drawdown Evaluation1.3%99%0.1%15.5
FTMO Futures Growth 50K Evaluation1.3%99%0.1%16.5
FTMO Futures Pro 50K Evaluation1.3%99%0.1%15.5
Scale 0 to 10%.
Figure 9. Simulated pass odds by plan, best first, with each plan's fail and out-of-time shares and the median sessions to a pass.

7Limitations

  • VWAP starts at the 08:20 ET COMEX open, not at the overnight open.
  • One market (MGC).
  • 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 helps. Its in-sample best, entry band (sigma) 3 and stop beyond the close (sigma) 2, had profit factor 0.76 in sample but 0.65 out of sample, against 0.68 for the defaults. On this reading of the rules, with these costs, the historical record gives no reason to expect a profit.

Every number on this page comes from the MGC bot above, run by our backtest engine on our own data. We publish what doesn't work as well as what does, and we don't tune rules to look good.

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.