Markets › Metals · XAUUSD spot (broker data), 5-minute
VWAP Standard Deviation Bands Strategy on Gold: Mean Reversion Backtest on XAUUSD 5-Minute Bars
When gold stretches far from its session VWAP, does it snap back far enough to pay for the trade? We backtested the classic VWAP mean reversion rule on 5-minute XAUUSD bars, in the London and the New York sessions, with costs and against the same trades on other days.
Buried · CostsFour cents before costs. Thirty cents of costs.
Variants tried: 2 · Passed every gate: 0 · Best: 1 of 6 · Holdout opened: yes (already used)
Short answer: not on gold in our test. Buying below the 2 standard deviation VWAP band and selling above it, with the VWAP as the target, ended at -$0.26 an ounce a trade in London and -$0.26 in New York after a $0.30 cost. Before costs it kept about +$0.04, and the same trades on other sessions did at least as well.
00The verdict in three lines
- Does VWAP mean reversion work on gold? Not in our test: 7,866 trades in the London session and 5,912 in New York, each at -$0.26 an ounce a trade after a $0.30 cost, with about 22% winners.
- Before costs it kept +$0.04 an ounce. The stops were so small (a median of $0.52 and $0.77) that the cost alone came to about 1.3 R and 1.0 R a trade on average.
- Buried, cause costs by our rule. But the same trades moved to other sessions did at least as well, so the bands themselves added nothing.
01The VWAP mean reversion strategy
The session VWAP is the average price weighted by volume since the session opened; the bands are drawn a number of standard deviations around it. The idea is simple: when price closes far from the VWAP it has stretched too far, so bet on the return.
- Buy when a 5-minute bar closes between 2 and 3 standard deviations below the VWAP; sell when it closes between 2 and 3 above it.
- Stop just beyond the 3 SD line. Target: the VWAP.
Not a new idea on this site, and we say so: the same band rule on ES futures lost $42.51 a trade, $11.75 of it before costs. We chose this test knowing that, because a result on one market says little about another; this is also one reason for the strict bar below.
02How we made the rules mechanical
- Sessions, each tested on its own, in real local time: London 08:00 to 16:30 London time; New York 09:30 to 16:00 New York time. Each has its own VWAP, which restarts every session.
- VWAP and bands, as in the ES test: typical price (high + low + close) / 3 of each 5-minute bar; VWAP = the sum of typical price x volume over the sum of volume; SD = the volume-weighted standard deviation around the VWAP.
- Signal: at a bar's close, from 30 minutes after the open (with few bars the deviation means nothing), not on the session's last bar. A close beyond the 3 SD line is not a signal.
- Entry: at the open of the next minute. Stop: $0.01 beyond the 3 SD line of the signal bar, fixed; if the entry is already beyond it, no trade. There is no minimum stop.
- Exit: at the open of the next minute after the first bar that closes at or beyond the current VWAP; otherwise at the stop or the session close. At most one trade per direction per session, one position at a time.
03How we tested it
XAUUSD, the 1-minute bid history and tick volume of an IC Markets MetaTrader 4 demo server, to 7 October 2026. A session must have its first minute and at least 80% of its minutes, which leaves almost nothing before 2007 (none at all in London in 2005): 4,919 London and 4,888 New York sessions. Costs: $0.30 an ounce a round trip, as in every gold test on the site, with $0.45 and $0.75 shown too. Unit: the gates are in R (a trade's result over its risk, entry to stop), because gold rose about tenfold and dollar totals weigh the recent years more; results in dollars are shown alongside. Periods: 2004 to 2012, 2013 to 2019, and a holdout from 2020 already used by our earlier gold tests. First-period bar t ≥ 2.5: the rule was chosen after a known result and many strategies have been tried on this file. Control: every trade moved to another session, at the same time after the open and in the same direction, with the stop at the same number of that session's standard deviations, 500 times. Engine check: 38 checks on hand-made sessions and real data, an independent re-implementation that matched every trade, and a mutation check in which deliberate changes to the rules must make the test fail (29 of 29 caught; gvb_selftest_result.txt).
04Results: does the VWAP bands strategy work on gold?
| Variant | Session | Trades | Win rate | Gross per trade, per oz | Net per trade, per oz | Net per trade | Net total | Profit factor | Verdict |
|---|---|---|---|---|---|---|---|---|---|
| GVB-LD | London, 08:00-16:30 London time | 7,866 | 21.6% | +$0.04 | -$0.26 | -1.179 R | -9,276 R | 0.39 | Buried |
| GVB-NY | New York, 09:30-16:00 New York time | 5,912 | 22.3% | +$0.04 | -$0.26 | -0.853 R | -5,045 R | 0.49 | Buried |
Cumulative net R by month. * Holdout already used before this test.
VWAP bands win rate: how the trades ended
| Variant | Back at the VWAP | Stop | Session close | Median stop | Median time in trade | Largest drawdown (closed trades) |
|---|---|---|---|---|---|---|
| GVB-LD | 20.6% | 77.9% | 1.4% | $0.52 | 5 min | -9,285 R |
| GVB-NY | 20.2% | 76.4% | 3.4% | $0.77 | 5 min | -5,088 R |
Half of the trades were over within 5 minutes. Price came back to the VWAP on about one trade in five and reached the stop on more than three in four.
05Why costs decide it: the stops are tiny
The bands sit close together, especially in quiet sessions, so the stop is usually under a dollar from the entry, and a $0.30 round trip is a large part of the risk. That is why the average in R is so far below the average in dollars.
| Variant | Before costs | $0.30 (base) | $0.45 | $0.75 | Mean cost in R, at $0.30 |
|---|---|---|---|---|---|
| GVB-LD | +$0.04 | -$0.26 | -$0.41 | -$0.71 | 1.32 R |
| GVB-NY | +$0.04 | -$0.26 | -$0.41 | -$0.71 | 1.01 R |
To break even, a round trip would have to cost about $0.04 an ounce, about a seventh of the $0.30 we assume in every gold test.
By stop size (descriptive, not a rule)
| Variant | Stop | Trades | Win rate | Gross per trade | Net per trade | Net per oz |
|---|---|---|---|---|---|---|
| GVB-LD | under $1 | 5,948 | 19.7% | +0.184 R | -1.503 R | -$0.27 |
| GVB-LD | $1 to $2 | 1,312 | 25.5% | -0.019 R | -0.245 R | -$0.33 |
| GVB-LD | $2 to $5 | 536 | 30.2% | +0.043 R | -0.070 R | -$0.12 |
| GVB-LD | over $5 | 70 | 42.9% | +0.352 R | +0.310 R | +$0.69 |
| GVB-NY | under $1 | 3,660 | 18.7% | +0.250 R | -1.269 R | -$0.25 |
| GVB-NY | $1 to $2 | 1,451 | 27.2% | +0.033 R | -0.192 R | -$0.25 |
| GVB-NY | $2 to $5 | 683 | 29.1% | -0.052 R | -0.163 R | -$0.41 |
| GVB-NY | over $5 | 118 | 33.1% | -0.051 R | -0.094 R | +$0.04 |
More than half of the trades had a stop under $1. Larger stops lose less in R, as they should, since the same cost is a smaller part of the risk. The only clearly positive group, London stops over $5, is 70 trades, and the same group in New York is negative in R and about flat in dollars; we read it as noise, and picking it after the results would prove nothing.
06VWAP bands or random session?
| Variant | Trades | Real net per trade | Moved trades, median | Moved, 5th to 95th | Percentile (95 needed) |
|---|---|---|---|---|---|
| GVB-LD | 7,866 | -1.179 R | -1.005 R | -1.121 R to -0.912 R | 1.0 |
| GVB-NY | 5,912 | -0.853 R | -0.774 R | -0.946 R to -0.535 R | 21.6 |
The same trades placed on other sessions, at the same time after the open and in the same direction, did better than the real ones in the median run. Being far from the VWAP did not pick better moments than chance: in London the real trades were worse than 99% of the random sets.
07The same rule on ES futures
| Test | Trades | Win rate | Reached the stop | Percentile against moved trades | Gates |
|---|---|---|---|---|---|
| ES, New York | 7,803 | 22.4% | 75.4% | 0.0 | 1/6 |
| Gold, London | 7,866 | 21.6% | 77.9% | 1.0 | 1/6 |
| Gold, New York | 5,912 | 22.3% | 76.4% | 21.6 | 1/6 |
Two different markets, two kinds of volume and the same shape: about 22% winners and three trades in four stopped. One difference: ES lost before costs, while gold kept a few cents.
08Long or short, trend or range (descriptive)
| Group | Trades | Win rate | Gross per trade | Net per trade | Net per oz |
|---|---|---|---|---|---|
| London, longs | 3,966 | 20.8% | +0.144 R | -1.199 R | -$0.26 |
| London, shorts | 3,900 | 22.4% | +0.140 R | -1.160 R | -$0.26 |
| New York, longs | 3,007 | 22.2% | +0.223 R | -0.692 R | -$0.23 |
| New York, shorts | 2,905 | 22.3% | +0.086 R | -1.020 R | -$0.30 |
| London, trend sessions | 3,202 | 18.8% | +0.017 R | -1.412 R | -$0.33 |
| London, range sessions | 4,664 | 23.5% | +0.227 R | -1.020 R | -$0.21 |
| New York, trend sessions | 2,319 | 17.2% | -0.068 R | -0.925 R | -$0.60 |
| New York, range sessions | 3,593 | 25.5% | +0.300 R | -0.807 R | -$0.04 |
A trend session is one whose open-to-close move is at least half of its high-to-low range. Fading works better in range sessions, as you would expect, but you only know which kind of session it was when it ends, so this cannot be a trading filter, and the range sessions still lost after costs.
09By period and by year
| Variant | 2004 to 2012 (trades) | 2013 to 2019 (trades) | Holdout* 2020 to Oct 2026 (trades) | t, first period | PF, second period |
|---|---|---|---|---|---|
| GVB-LD | -1.434 R (2,220) | -1.439 R (2,845) | -0.714 R (2,801) | -5.84 | 0.34 |
| GVB-NY | -0.802 R (1,828) | -1.262 R (2,109) | -0.464 R (1,975) | -5.51 | 0.38 |
| Year | GVB-LD net R (trades) | net per oz | GVB-NY net R (trades) | net per oz |
|---|---|---|---|---|
| 2004 (from 11 Jun) | -6.0 R (3) | -$1.26 | -102.7 R (28) | -$9.32 |
| 2005 | no trade | - | -3.7 R (5) | -$2.97 |
| 2006 | -27.2 R (8) | -$2.78 | -67.1 R (42) | -$18.54 |
| 2007 | -447.5 R (219) | -$60.90 | -227.8 R (253) | -$53.09 |
| 2008 | -659.4 R (391) | -$87.80 | -143.8 R (317) | -$10.29 |
| 2009 | -610.7 R (409) | -$109.32 | -273.7 R (313) | -$77.33 |
| 2010 | -540.4 R (398) | -$92.57 | -361.4 R (284) | -$83.06 |
| 2011 | -428.4 R (390) | -$48.15 | -26.5 R (312) | -$0.95 |
| 2012 | -463.5 R (402) | -$111.71 | -259.2 R (274) | -$120.19 |
| 2013 | -299.9 R (404) | -$120.47 | -421.6 R (305) | -$91.44 |
| 2014 | -541.3 R (418) | -$53.10 | -168.1 R (290) | -$81.91 |
| 2015 | -507.0 R (406) | -$84.64 | -250.4 R (274) | -$51.02 |
| 2016 | -619.4 R (424) | -$86.95 | -240.5 R (308) | -$84.23 |
| 2017 | -901.6 R (398) | -$128.45 | -397.8 R (306) | -$112.56 |
| 2018 | -616.5 R (387) | -$95.51 | -425.0 R (327) | -$69.46 |
| 2019 | -608.6 R (408) | -$151.90 | -758.2 R (299) | -$117.75 |
| 2020 | -316.8 R (405) | -$98.17 | -206.0 R (301) | -$58.98 |
| 2021 | -300.0 R (424) | -$145.45 | -174.8 R (259) | -$67.40 |
| 2022 | -250.2 R (401) | -$128.98 | -76.8 R (300) | -$40.68 |
| 2023 | -373.1 R (418) | -$107.62 | -192.5 R (271) | -$142.64 |
| 2024 | -406.1 R (429) | -$193.69 | -97.9 R (312) | -$113.31 |
| 2025 | -269.8 R (403) | -$167.90 | -199.6 R (286) | -$111.42 |
| 2026 (to 7 Oct) | -82.9 R (321) | +$37.00 | +30.6 R (246) | -$33.74 |
* The holdout years were already used by our earlier gold tests.
In R, London lost in each of its 22 years with trades, and New York in 22 of 23; its one exception, 2026, was still negative in dollars.
10Does the clock matter?
The broker's file labels some weeks an hour off, which matters for rules tied to a session. This test uses the clock of our clock audit, built on the 08:30 US data releases; we repeated it on the correction used by our EMA 9/20 gold test and on the uncorrected file.
| Variant | Clock audit (this test): net per trade (per oz; before costs; gates) | EMA 9/20 test's correction: net per trade (per oz; before costs; gates) | Uncorrected file: net per trade (per oz; before costs; gates) |
|---|---|---|---|
| GVB-LD | -1.179 R (-$0.26; before costs +0.142 R; 1/6) | -1.972 R (-$0.25; before costs -0.063 R; 1/6) | -2.007 R (-$0.26; before costs -0.065 R; 1/6) |
| GVB-NY | -0.853 R (-$0.26; before costs +0.156 R; 1/6) | -0.837 R (-$0.26; before costs +0.151 R; 1/6) | -0.835 R (-$0.26; before costs +0.153 R; 1/6) |
Every version lost and was buried on all three clocks, and the result in dollars barely moves. The average in R for London moves a lot, and its figure before costs changes sign: with so many tiny stops, a few trades can swing an average in R. That is why we also show dollars, and why the “costs” label is not the main message here.
11The gates
| Variant | Trades | 1. PF ≥ 1.2 in validation | 2. ≥ 50 trades in each period | 3. t ≥ 2.5 on development | 4. Above the 95th percentile of the moved-trade control | 5. Positive without the 10 best trades | 6. Holdout net positive (already used) |
|---|---|---|---|---|---|---|---|
| GVB-LD | 7,866 | fail | pass | fail | fail | fail | fail |
| GVB-NY | 5,912 | fail | pass | fail | fail | fail | fail |
| Variant | Cause | Gates failed | Verdict |
|---|---|---|---|
| GVB-LD | Costs | 1, 3, 4, 5, 6 | Buried |
| GVB-NY | Costs | 1, 3, 4, 5, 6 | Buried |
The data-gap check removed 8 and 2 trades touching a gap of more than 30 minutes; no verdict changed. Costs: positive before costs, negative after.
TWhat this shows, and what to take into your own tests
What the results show
- Fading gold at 2 to 3 standard deviations from the session VWAP lost after costs in London and in New York: -$0.26 an ounce a trade on both, or -1.179 R and -0.853 R.
- Before costs it kept about +$0.04 an ounce a trade, against a cost of $0.30. The stops were tiny (a median of $0.52 in London, $0.77 in New York), so the cost was about 1.0 R or more a trade on average.
- The same trades moved to other sessions did at least as well, so being far from the VWAP added nothing. The rule looked the same on ES futures: about 22% winners and three trades in four stopped.
What remains unknown
- COMEX gold futures, with real contract volume and their own session. We used a broker's spot price and tick volume.
- Other settings: wider bands, a stop further from the entry, a minimum stop. We fixed one version in advance and did not search for a better one.
- Whether a trader paying close to $0.04 an ounce could keep anything; the cost we assume is about seven times that.
Why it was buried
It lost in all three periods and in nearly every year. By our rule the cause is costs, because it was slightly positive before them. But the moved trades did at least as well, so this is not a good signal held back by costs: there is little signal there, and the small stops make the cost enormous.
What you can apply to your own tests
- Compare your cost with your stop before anything else: $0.30 on a $0.52 stop is over half of the risk.
- A chart where price keeps returning to the VWAP is not an edge: compare the same trades on other days.
- Averages in R can swing on a handful of tiny stops; look at the result in money as well.
A note on the numbers: drawdown figures are measured on closed trades unless a table says it includes open losses. Open losses inside a trade are not counted in a closed-trade drawdown, so real account risk is higher, especially for systems with no stop. Backtests are not live trading.
FAQCommon questions
Does VWAP mean reversion work on gold?
Not in our backtest of XAUUSD 5-minute bars: 7,866 trades in the London session and 5,912 in New York, each ending at about -$0.26 an ounce a trade after costs. Both versions were buried, with one of six gates.
What is the win rate of a VWAP bands strategy?
About 22% on gold in our test (78% and 76% of trades reached the stop), much the same as the 22% we measured with the same rule on ES futures.
What are VWAP standard deviation bands?
Lines drawn a number of standard deviations above and below the session VWAP, using the volume-weighted standard deviation of price around it. Traders often read the 2 and 3 SD bands as stretched prices that should return to the VWAP.
Why do small stops hurt this strategy?
The bands are close together, so the median stop was only $0.52 in London and $0.77 in New York. A cost of $0.30 an ounce then takes about 1.0 R or more a trade on average.
How was the VWAP bands strategy tested on gold?
On XAUUSD 1-minute data and tick volume, built into 5-minute bars of the London and New York sessions, with the rules fixed before any band was computed, and rules written and dated before the data was run, costs included on every trade, results split into development, validation and holdout periods, a random-entry control as the benchmark, and every variant reported. Read the protocol.
12Check our arithmetic
gvb_spec.md
gvb_lib.js · gvb_ref.js · gvb_selftest.js · gvb_mutate.js · gvb_run.js
control_audit_lib.js · em_lib.js · fx_data.js · gh_lib.js · gold_audit_clock.js · gx_lib.js · hourly_lib.js · ma_lib.js · na_lib.js · rb_lib.js · rsi2_protocol.js · clock_audit_fix.json · data_manifest.md
gvb_selftest_result.txt · gvb_mutation_result.txt · gvb_results.txt · gvb_results_gx.txt · gvb_results_raw.txt · gvb_clocks.json · gvb_summary.json
Code provenance: our own code, written from the specification.
13Data notes
Source. A broker's demo history of spot gold (bid prices), not COMEX futures. Volume. Tick volume, a proxy: spot gold has no contract volume. Until about 2008 the median minute has only a few ticks, so the VWAP is close to a plain average of prices; in 2026 the count jumps, so tick volume is not comparable across years, but only the weights inside a session matter. Coverage. In practice the test starts in 2007; missing minutes are never filled. Fills: entries and VWAP exits at a minute's open, stops at their level or a minute's open if it gapped through. The cost is a fixed $0.30 for 22 years, because the file has no historical spread. Exploratory: one market, one broker, a holdout already used.
14Corrections
None since publication.