Research result
No edge foundGold (XAU/USD) mean reversion
XAU/USD · hourly barsAug 2020 – Aug 2025 · 29,581 hourly candles · spread fixed at 0.30 USD/oz
Gold's deviations from its Kalman equilibrium are strongly mean-reverting, yet trading them was not profitable after costs. Buy-and-hold gold gained 85% over the same period.
- Hypothesis tested
- Short-term deviations of gold from a causally filtered equilibrium can be traded profitably after costs, with little dependence on gold's own direction.
- Result
- Not supported. The independence from gold's direction held (beta +0.035), but the profit did not: the Sharpe ratio was −0.61 in the full backtest and −0.67 on unseen data.
- How it was tested
- Costs included
- Tested on unseen data
- 1,000 bootstrap paths
- Total return (1 lot)
- −27.8%
- Sharpe ratio
- −0.61
- Max drawdown
- −36.0%
- Profit factor
- 0.87
- Walk-forward Sharpe
- −0.67
- Gold buy-and-hold
- +85.0%
Sharpe 0.81, max drawdown −21.9%
This is the full report behind the summary above. Every number is the actual output of running the study end to end on 29,581 hourly gold bars, and a separate check step recomputes each headline figure with independent code (46 checks, all passed).
1. Strategy overview
1.1 Research question and hypotheses
The question is simple to state. Can short-term deviations of XAU/USD (spot gold in US dollars per troy ounce) from its own recent equilibrium be traded profitably, after realistic costs, using nothing but the instrument's own price history? There is no hedge and no second instrument.
Let be the observed mid price (the average of the bid and the ask) and the Kalman filter's one-step-ahead estimate of the local equilibrium. A Kalman filter is a recursive method that keeps a running estimate of a hidden level from noisy observations. Here the estimate is built strictly from earlier prices. The quantity that is traded is the residual spread:
H0. The residual has a unit root. A unit root means the series behaves like a random walk and does not return to a stable average. If H0 is true there is no exploitable structure, and any apparent edge is noise that disappears once costs are included.
H1. During London and New York hours, the residual behaves like a stationary Ornstein–Uhlenbeck process with a short half-life. This is a standard model of mean reversion, and the half-life is the time it takes for half of a deviation to disappear. If H1 is true, buying large negative deviations, selling large positive ones, and exiting at the mean should make money after costs, with little correlation to gold's own direction.
The statistical side is tested with two rolling checks, computed only on data available at each point in time. The Augmented Dickey–Fuller (ADF) test starts from H0 and tries to reject the unit root. The KPSS test works the other way: it starts from the assumption that the series is stationary and tries to reject that. The economic side is judged by out-of-sample walk-forward results and a Monte Carlo simulation, not by the in-sample backtest alone. The study reports its result without changing settings afterwards to produce a better-looking number.
1.2 The idea behind the hypothesis
This is the reasoning that led to the hypothesis. The study does not test it directly, because it has no order-book data. It tests only whether the resulting trading rule makes money.
Gold trades almost 24 hours a day, but liquidity depends strongly on the session. When Asian order books are thin, even moderate order flow can push the price several dollars away from where deeper two-sided interest would settle it. When London opens, institutional liquidity providers come online, quotes tighten, and the price tends to be pulled back. The same can happen around the New York open and around macro news releases. So the object being traded is not a forecast of gold's direction. It is the fading of a displacement caused by liquidity.
The study gives three reasons why such an edge might not be removed at once. The profit per trade is small compared with trading frictions. The imbalance being absorbed is limited in size, so capacity is modest. And holding the other side of the move means carrying directional gold risk for hours through news-sensitive periods, which many market makers avoid.
1.3 Signal generation and execution
| Element | Rule | Why |
|---|---|---|
| Equilibrium | Kalman filter, one-step-ahead estimate from past prices only. The noise ratio is chosen once on a burn-in period, then frozen. | A fair value that adapts over time, with no look-ahead |
| Residual and Z-score | , standardized as , using the mean and standard deviation over the trailing 240 bars | A deviation measure that is not tied to a price level |
| Entry | goes long and goes short, checked at the close of bar and filled at the open of bar | Keeps the strategy strictly causal |
| Exit | Close the trade once crosses 0 | Take the reversion profit |
| Stop loss | Exit if moves against the position to | Cut trades where the setup has broken down |
| Time stop | Force an exit after 72 bars (about 3 trading days) | Do not let a trade drag on |
| Session gate | Enter only if the bar where the order is filled starts between 07:00 and 17:00 UTC | Tests H1: London and New York hours |
| Volume gate | Enter only if bar volume is at least 40% of its trailing median | Skip dead or holiday hours |
| Stationarity gate (circuit breaker) | Enter only if the latest rolling ADF test rejects a unit root at the 5% level. Positions already open run to their normal exit. | Stop opening trades when the setup stops looking valid |
| Position size | Specified book: fixed 5 lots (500 ounces). Reference book: fixed 1 lot (100 ounces). | See Section 2.6 |
| Costs | Buys fill at the ask and sells at the bid, plus 0.05 USD per ounce of slippage per side and $3.50 commission per lot per side | Realistic accounting |
All exits are filled at the next bar's open as well, with the same costs.
1.4 How look-ahead bias is avoided
- A filter, not a smoother. The equilibrium at time uses only prices before . A smoother or any centered rolling window would leak future prices into the estimate, and none is used.
- Next-bar fills. A signal formed at the close of bar is filled at the open of bar . Bar 's own high or low is never tradable.
- Trailing windows. The ADF and KPSS tests, the Z-score mean and standard deviation, and the volume gate all use windows that end at the decision bar.
- Frozen noise settings. The Kalman noise ratio is chosen on the first 3,000 bars only and then frozen. No trading takes place during that burn-in.
- Recursive updates. Every state update is recursive, so removing future rows cannot change a past signal. The study says the walk-forward test re-checks this by running the same pipeline on separate time slices.
1.5 Configuration
| Parameter | Value |
|---|---|
| Instrument and bars | XAU/USD, hourly bars |
| Data window | 2020-08-02 22:00 to 2025-08-01 20:00 UTC (29,581 bars, 4.99 years) |
| Contract | 1 lot = 100 troy ounces. 1 pip is defined as 0.10 USD per ounce. |
| Starting account equity | $100,000 |
| Lots per trade | 5 (specified book) and 1 (reference book), fixed |
| Spread | The quoted bid-ask spread of each bar (average 0.30 USD per ounce) |
| Slippage | 0.05 USD per ounce per side (0.5 pips) |
| Commission | $3.50 per lot per side |
| Risk-free rate (annual) | 4% |
| Kalman burn-in | 3,000 bars (about 6 months), no trading |
| Z-score window | 240 bars (about 2 trading weeks) |
| , , | 2.0, 0.0, 4.0 |
| Time stop | 72 bars |
| Session window (UTC) | 07:00 to 17:00, on the fill bar |
| Volume gate | At least 40% of the trailing 240-bar median |
| ADF window, stride, α | 1,250 bars (about 10 trading weeks), 24 bars (daily), 0.05 |
| KPSS window, stride | 1,250 bars, 24 bars |
| Walk-forward train and test | 6 months and 1 month |
| Walk-forward values | 1.50, 1.75, 2.00, 2.25, 2.50 (at least 6 trades needed in training) |
| Monte Carlo | 1,000 paths, blocks of 5 trades |
| Ruin rule | Trading halts for good once marked equity reaches zero |
| Random seed | 42 |
2. Technical implementation
2.1 Data
The study uses hourly XAU/USD bars with separate bid and ask prices and a volume figure. The report describes the data as real broker quotes (Dukascopy bid and ask history), loaded from a local cached file. The loader also contains a simulated fallback for offline use, and the report states that this fallback was never used.
- The study asked for the five years from 2021-01-01. Because the data end on 2025-08-01, the loader moved the start back to 2020-08-02 to keep the five-year minimum.
- The result is 29,581 hourly bars from 2020-08-02 22:00 to 2025-08-01 20:00 UTC, which is 4.99 years.
- The quoted spread has an average of 0.30 USD per ounce and a median of 0.30 USD per ounce. That is about 1.47 basis points of the mid price. It is the same on every bar: the right panel of Exhibit 1 shows a single value, and the small offsets on its axis are floating-point rounding of about one part in .
The study's own limitations section says that when it uses its backup public data mirrors, the bid-ask gap is an assumed constant spread (0.30 USD per ounce by default) and not a true quote. Because the spread here is the same on every bar, the cost level behaves like a fixed assumption. The cost stress in Section 5.2 shows how the result changes at two and three times the costs.
Exhibit 1
Hourly gold mid price (left) and the quoted spread (right), which is 0.30 USD per ounce on every bar

2.2 Data checks
Before any statistic was computed, the study ran an integrity report on the data. Every hard check passed:
- Rows: 29,581. Duplicate timestamps: 0. Non-positive prices: 0.
- Rows where the ask is below the bid, for the open, high, low and close: 0 in each case.
- Rows where the bid high or low is inconsistent with the bid open and close: 0.
2.3 Kalman equilibrium filter
The filter is a local-level model, the simplest Kalman filter. It tracks one hidden level, the equilibrium, that moves as a random walk and is seen through noise:
At each bar the filter predicts and then compares the prediction with the new price. The difference is the innovation , with variance . The estimate is updated with the gain :
The filter is run once, forward in time. The innovation uses only prices before , so it is a strictly causal measure of the spread from equilibrium.
Choosing the noise ratio. The ratio sets how fast the equilibrium adapts. The observation noise is tied to the variance of hourly price changes. The study chose on the first 3,000 bars only (the burn-in) and then froze it. It did not use the likelihood for this choice. The study explains that likelihood alone keeps improving as the filter speeds up, until the equilibrium chases the price bar by bar and the residual becomes almost white noise ( close to 0). A residual like that has no persistence left to trade after the one-bar execution delay. A very slow filter fails the other way: the random-walk part of the price leaks into the residual and the deviations never revert within a tradable time.
The study therefore used an explicit tradability score. Among candidates whose burn-in residual rejects a unit root, it picked the that maximizes
Here is the residual's persistence (how much of a deviation is still there one bar later), and is its typical size. The factor rewards a deviation that survives the one-bar delay, and the factor rewards a deviation that completes its reversion within 24 bars.
| (USD/oz) | ADF p-value | Log-likelihood | Score | ||||
|---|---|---|---|---|---|---|---|
| 0.0001 | 0.0009 | 9.4636 | 0.9853 | 25.4353 | 0.0000 | −112,307.38 | 7.4943 |
| 0.0003 | 0.0030 | 9.4625 | 0.9800 | 21.8664 | 0.0000 | −82,328.38 | 8.2181 |
| 0.0010 | 0.0095 | 9.4593 | 0.9701 | 17.9056 | 0.0000 | −56,210.11 | 8.9896 |
| 0.0032 (selected) | 0.0299 | 9.4491 | 0.9502 | 13.9526 | 0.0000 | −35,820.40 | 9.3631 |
| 0.0100 | 0.0942 | 9.4169 | 0.9129 | 10.6491 | 0.0000 | −22,810.09 | 8.6297 |
| 0.0316 | 0.2946 | 9.3167 | 0.8478 | 8.1949 | 0.0000 | −15,515.25 | 6.8155 |
| 0.1000 | 0.9013 | 9.0134 | 0.7428 | 6.4913 | 0.0000 | −11,684.24 | 4.8179 |
The study tested eight smaller values of as well. In its output they print as 0.0000 for both and , so they are not listed here. Their scores were between 6.26 and 6.92, and their log-likelihoods were lower than those above. The selected value is , which gives and . The steady-state gain is about 0.0547: in the long run, each hour the equilibrium moves about 5.5% of the way toward the latest surprise. The table shows the pattern the study describes: the likelihood is highest at the largest , and the score peaks in between.
Exhibit 2
Price against the causal Kalman equilibrium (three weeks in February 2023), and the residual spread

2.4 Residual model
The residual is modelled as an Ornstein–Uhlenbeck process, . Observed once per hour, it becomes an AR(1) process, a series where each value depends on the one before it. The study estimates it by ordinary least squares on the change in the residual:
The stationary scale, the typical size of a deviation, is , and the long-run mean is . The time step is one hour. Fitted on the full residual sample (29,580 observations):
- Intercept : 0.046383. Slope : −0.054135, with a t-statistic of −28.63 and a p-value of about . This p-value comes from an ordinary regression t-test. The ADF test in Section 2.5 is the formal unit-root test.
- AR(1) coefficient : 0.94587. About 5.4% of a deviation disappears each hour.
- Reversion speed : 0.055655 per bar.
- Half-life: 12.454 bars, which is about 12.5 hours.
- Long-run mean : 0.8568 USD per ounce.
- Stationary scale : 13.436 USD per ounce.
This fit describes the whole sample in hindsight. The trading rules do not use it. They use only trailing windows.
The study also ran a Ljung–Box test on the hourly changes of the residual. Its starting assumption is that the changes are white noise, meaning no serial structure. The test rejects it at every lag tested, so the reversion is real serial structure and not noise:
| Lags | Test statistic | p-value |
|---|---|---|
| 1 | 95.7921 | 0.00000 (rounded) |
| 5 | 159.9292 | 0.00000 (rounded) |
| 10 | 178.5341 | 0.00000 (rounded) |
2.5 Stationarity monitor
A rolling ADF test checks the residual over a window of 1,250 bars (about 10 trading weeks) and is refreshed every 24 bars. The latest result is used for decisions from the close of the bar where the window ends. A rolling KPSS test runs on the same schedule.
- The ADF test rejected the unit root in 95.8% of bars. The figure is the same, 95.8%, when only London and New York hours are counted.
- The study states that the test never once failed to reject the unit root across the full five years, including through the 2022 rate-hike period. The 95.8% figure counts all 29,581 bars, including the first 1,249 bars, which come before the first full 1,250-bar window and so have no test result. This matches: 1 − 1,249 ÷ 29,581 is 0.958.
- The KPSS test did not reject stationarity in 70.5% of bars. It is the less decisive of the two.
Exhibit 3
Rolling ADF and KPSS p-values on the residual. The ADF p-value stays near zero, so no entry was blocked

The ADF test is the one used as the circuit breaker. Section 5.3 shows what happened: it never stopped an entry.
2.6 Event-driven backtest and the two books
The backtest steps through the data bar by bar, with no shortcuts that could hide a timing error. At the close of bar it computes and checks every gate. A triggered trade is filled at the open of bar , at the ask plus slippage for a buy or the bid minus slippage for a sell, and commission is charged per lot per side. A multiplier can scale the half-spread, the slippage and the commission together, which is how the cost stress in Section 5.2 works. Each bar the open position is marked to market at the mid close. A position still open on the last bar is closed with full costs.
Warm-up ended at bar 3,001 (2021-02-04 05:00), and the tradable sample is 26,580 bars. The first trade was entered at 10:00 on 2021-02-04.
Two books, one strategy. Position size is fixed, not compounded, so profit and loss is exactly linear in the number of lots. Profit factor, win rate and every per-trade statistic are therefore the same at any lot size, and the Sharpe and Sortino ratios differ only through the risk-free hurdle. What does change with size is whether the account survives. The study therefore reports two books side by side:
- Specified book: the fixed 5 lots (500 ounces) that the study design requires. It tests survival.
- Reference book: a fixed 1 lot (100 ounces). It shows the edge on the full, uncensored sample.
Nothing is re-tuned between the two.
Ruin guard. If a book's marked equity reaches zero, trading halts permanently, any open position is closed at the next open, and equity is frozen.
How performance is measured. Returns are measured against the starting capital, , where is account equity. This is the right convention for fixed-lot sizing, because equity does not decide the position size. The Sharpe and Sortino ratios use hourly excess returns over the 4% risk-free rate and are scaled by the realized number of bars per year. Sortino uses the downside deviation over the whole sample, not only over the losing bars. Beta and alpha come from regressing the strategy's hourly returns on buy-and-hold gold's hourly returns over the same window, using the same convention. That makes the buy-and-hold benchmark's own beta exactly 1.0, which is a check that the regression is set up correctly.
3. Backtest results
3.1 Headline metrics
| Metric | Specified 5 lots (ruined) | Reference 1 lot | Buy-and-hold gold |
|---|---|---|---|
| Total return | −101.58% | −27.84% | +85.00% |
| Annualized return | −100.00% | −7.01% | +14.69% |
| Sharpe ratio | −0.920 | −0.612 | 0.809 |
| Sortino ratio | −1.244 | −0.840 | 1.123 |
| Maximum drawdown | −101.56% | −36.00% | −21.88% |
| Profit factor | 0.537 | 0.871 | n/a |
| Win rate | 47.4% | 55.3% | n/a |
| Average trade duration | 24.6 bars | 25.6 bars | n/a |
| Number of trades | 57 | 264 | 0 |
| Final equity | −$1,575 | $72,157 | $184,996 |
| Beta versus buy-and-hold gold | +0.0323 | +0.0353 | 1.0000 |
| Alpha (annualized) | −23.24% | −6.87% | 0.00% |
| Beta R² | 0.0004 | 0.0015 | 1.0000 |
These use standard definitions. Win rate is the share of trades that made money. Maximum drawdown is the worst peak-to-trough fall in equity. The Sharpe ratio measures return above the risk-free rate per unit of risk. Sortino penalises only downside volatility. Profit factor is total gains divided by total losses. Beta measures how much the strategy moves with gold, and R² is the share of its variation that gold's direction explains. Alpha is the average return left over after the part explained by beta is removed.
The buy-and-hold column is gold held over the same period as the reference book, marked at the mid price with no trading costs.
The 5-lot book does not survive. It reaches account ruin at 15:00 on 2022-01-27. At that point the engine's ruin guard closes the position and freezes the equity curve. Final equity is below zero (−$1,575), because the guard closes the position at the next open, after the mark has already reached zero. The −101.58% total return is measured against the $100,000 start. Its profit factor (0.537) and win rate (47.4%) differ from the 1-lot book because the 5-lot book stops at ruin, so its figures cover just 57 trades. The ratio metrics do not depend on size, so ruin changes the conclusion about survival but not the conclusion about the edge. The reference book shows what the strategy's edge looks like, and it is negative.
3.2 Equity curve and drawdown
Exhibit 4
Equity of the 1-lot and 5-lot books against buy-and-hold gold, the 1-lot drawdown, trade profit and loss, and the standardized residual

The top panel shows the three paths. The 1-lot book drifts down with long flat stretches and ends at $72,157. The 5-lot book falls steeply from the first months, recovers part of the loss in late 2021, and reaches zero on 2022-01-27. Buy-and-hold gold ends at $184,996. The middle panel shows that the 1-lot book's drawdown, which reaches its maximum of −36.00%, is deepest in the spring of 2025.
The bottom-left panel shows the profit and loss of each of the 264 round trips. The mean is −$105 per trade. Most trades sit between about −$5,000 and +$5,000, and one very large loss lies far to the left of the rest, near −$15,000. The bottom-right panel shows the standardized residual after warm-up, with the entry bands at ±2 and the stop bands at ±4. The residual reaches beyond the stop bands on both sides.
3.3 Worked example: the first ten trades
These are the first ten of the 264 round trips of the 1-lot book. The commission column is the only cost shown in the trade log. The fill prices already include half the spread and the slippage.
| Entry time | Exit time | Side | Entry price | Exit price | Bars held | Gross P&L | Commission | Net P&L |
|---|---|---|---|---|---|---|---|---|
| 2021-02-04 10:00 | 2021-02-04 15:00 | long | 1,814.43 | 1,785.54 | 5 | −$2,889 | $7 | −$2,896 |
| 2021-02-04 16:00 | 2021-02-05 09:00 | long | 1,786.66 | 1,808.13 | 16 | +$2,147 | $7 | +$2,140 |
| 2021-02-08 14:00 | 2021-02-11 02:00 | short | 1,829.52 | 1,838.77 | 57 | −$925 | $7 | −$932 |
| 2021-02-16 14:00 | 2021-02-18 09:00 | long | 1,796.92 | 1,787.41 | 41 | −$951 | $7 | −$958 |
| 2021-02-22 16:00 | 2021-02-23 15:00 | short | 1,808.66 | 1,801.59 | 22 | +$707 | $7 | +$700 |
| 2021-02-26 15:00 | 2021-02-26 17:00 | long | 1,745.04 | 1,717.71 | 2 | −$2,733 | $7 | −$2,740 |
| 2021-03-09 12:00 | 2021-03-12 04:00 | short | 1,708.72 | 1,718.49 | 61 | −$977 | $7 | −$984 |
| 2021-03-29 14:00 | 2021-03-31 14:00 | long | 1,711.24 | 1,696.99 | 46 | −$1,425 | $7 | −$1,432 |
| 2021-03-31 16:00 | 2021-04-06 19:00 | short | 1,707.88 | 1,743.51 | 72 | −$3,563 | $7 | −$3,570 |
| 2021-04-15 15:00 | 2021-04-19 13:00 | short | 1,764.45 | 1,776.18 | 44 | −$1,173 | $7 | −$1,180 |
For each trade the gross P&L is the price move between the two fills times the position size (100 ounces for 1 lot), and then $7 of commission is subtracted ($3.50 per lot per side, 2 sides). For the second trade, a price rise of 1,808.13 − 1,786.66 = 21.47 dollars per ounce on 100 ounces is $2,147 gross, minus $7 commission, which is $2,140 net and matches the ledger. The ninth trade ran for 72 bars, which is the time stop.
3.4 Where the money was lost
By side
| Side | Trades | Win rate | Total P&L | Average P&L | Average bars held |
|---|---|---|---|---|---|
| Long | 133 | 60.2% | +$836 | +$6.29 | 24.9 |
| Short | 131 | 50.4% | −$28,679 | −$218.92 | 26.4 |
Long trades were roughly break-even. Short trades produced almost all of the loss. The study reads this as consistent with gold's strong uptrend over 2020 to 2025 working against the short side of a rule that treats both directions the same way. The near-zero beta in Section 3.6 does not show this, because the effect is concentrated in one leg.
Gross P&L, commission and net P&L. Across the 264 trades, gross P&L was −$25,995, commission was $1,848 (an average of $7 per trade), and net P&L was −$27,843.
Read the gross figure with care. It is not a cost-free figure. Each fill already includes half the quoted spread and the slippage, so gross P&L is the price move between two fills that have both paid those costs. The cost column in the trade log holds the commission only.
For this reason the split between gross P&L and commission is not a full picture of trading costs. The cost stress in Section 5.2 is the better guide: tripling all costs (half-spread, slippage and commission together) moved the return at the base threshold from −27.8% to −52.7%.
3.5 Trade timing
Exhibit 5
Net P&L by entry hour (UTC), holding period, and cumulative net P&L by trade number

The left panel shows that no single hour of entry makes money in a steady way. Entries at 07:00 and 16:00 UTC lost the most, and entries at 11:00 UTC gained the most. The middle panel shows how long trades lasted. The average was 25.6 bars, about twice the half-life of 12.5 bars. A small group of trades ran to the 72-bar time stop, which is the right-most bar. The right panel shows the running total. It spends nearly the whole sample below zero, only briefly reaching zero, and it falls sharply over the final trades.
3.6 Market exposure
The regression of the 1-lot book's hourly returns on buy-and-hold gold's hourly returns gives a beta of +0.0353 and an R² of 0.0015. Gold's direction therefore explains only 0.15% of the variation in the strategy's returns, and the average directional exposure is negligible. This part of H1, little dependence on gold's own direction, holds. Alpha, the part of the return that is not explained by beta, is −6.87% a year. The strategy was close to market-neutral, but its return was negative.
4. Integrity verification
The study includes a dedicated step that recomputes every headline number a second time with independent code and checks the trade log against the raw price data. If anything differs, the run stops. A clean pass means each of these held on this data:
- The cash ledger balances: final equity minus starting equity equals the sum of all trade P&L, for both the 1-lot and the 5-lot book.
- Every trade's P&L was recomputed. Net equals gross minus commission, commission equals 2 × $3.50 × lots, and gross equals side × ounces × (exit price − entry price).
- For the first ten trades, each entry came after warm-up, the standardized residual's absolute value was at or above the entry threshold on the bar before the fill, and the fill price equaled the raw next-bar open (the ask for buys, the bid for sells) plus or minus the slippage.
- Sharpe, Sortino, maximum drawdown, total return, annualized return, profit factor, win rate, trade count and average duration were recomputed with separate code and matched.
- The beta regression was reproduced by hand, and the buy-and-hold benchmark's own beta came out at exactly 1.
- After ruin, the 5-lot book's equity stayed frozen.
Result: 46 checks, all passed.
5. Risk and robustness
5.1 Regime performance
By calendar year. Each year's return is measured from the equity at the start of that year, so it is not simply the year's P&L divided by $100,000. The first year starts on 2021-02-04, and 2025 runs to 2025-08-01.
| Year | Return | Sharpe | Maximum drawdown | Trades | Net P&L |
|---|---|---|---|---|---|
| 2021 | −16.7% | −1.790 | −19.2% | 53 | −$16,681 |
| 2022 | +14.6% | 0.639 | −8.6% | 65 | +$12,186 |
| 2023 | −4.6% | −0.635 | −17.8% | 59 | −$3,254 |
| 2024 | −13.3% | −0.885 | −22.2% | 55 | −$13,194 |
| 2025 | −8.7% | −0.557 | −33.0% | 32 | −$6,900 |
Only 2022 made money. The 1-lot book's worst year by return was 2021, and its deepest drawdown within a year was in 2025.
By volatility level. Volatility is the average bar range over the previous 240 bars at the time of entry. It is split into low, mid and high thirds of its distribution over the tradable sample.
| Regime | Trades | Win rate | Total P&L | Average P&L |
|---|---|---|---|---|
| Low | 98 | 52.0% | −$21,162 | −$215.94 |
| Mid | 86 | 55.8% | +$11,420 | +$132.79 |
| High | 80 | 58.8% | −$18,101 | −$226.26 |
By entry hour. All entries fall between 07:00 and 17:00 UTC.
| Entry hours (UTC) | Trades | Win rate | Total P&L | Average P&L |
|---|---|---|---|---|
| London open, 07:00 to 09:59 | 51 | 54.9% | −$5,268 | −$103.29 |
| Mid-session, 10:00 to 12:59 | 35 | 57.1% | −$1,247 | −$35.63 |
| New York overlap, 13:00 to 16:59 | 178 | 55.1% | −$21,328 | −$119.82 |
Exhibit 6
Sharpe ratio by calendar year (left) and net P&L by volatility regime (right)

The results do not support a clean regime story. No entry-hour group made money. The New York overlap bucket, which has the most trades, lost the most in total. Only the middle volatility group was profitable, and the high-volatility group had the highest win rate yet still lost money. The win rate on its own is not a reliable guide here.
5.2 Sensitivity: cost and threshold stress
The study repeated the backtest with all costs (half-spread, slippage and commission) multiplied by 1, 2 and 3, and with the entry threshold moved by 20% either way (1.6 and 2.4 around the base of 2.0). Each row is a separate backtest of the 1-lot book.
| Cost multiple | Entry threshold | Sharpe | Profit factor | Total return | Maximum drawdown | Trades |
|---|---|---|---|---|---|---|
| 1× | 1.6 | −0.841 | 0.811 | −58.0% | −61.0% | 371 |
| 1× (base) | 2.0 (base) | −0.612 | 0.871 | −27.8% | −36.0% | 264 |
| 1× | 2.4 | −0.435 | 0.940 | −8.0% | −23.2% | 179 |
| 2× | 1.6 | −1.033 | 0.760 | −75.4% | −77.4% | 371 |
| 2× | 2.0 | −0.778 | 0.819 | −40.3% | −47.4% | 264 |
| 2× | 2.4 | −0.576 | 0.880 | −16.4% | −27.8% | 179 |
| 3× | 1.6 | −1.226 | 0.711 | −92.9% | −94.6% | 371 |
| 3× | 2.0 | −0.943 | 0.769 | −52.7% | −59.3% | 264 |
| 3× | 2.4 | −0.717 | 0.824 | −24.8% | −35.5% | 179 |
Sharpe gets steadily worse as costs rise and as trade frequency rises. A higher threshold means fewer trades and a smaller loss, but even the best cell (1× costs, threshold 2.4) has a negative Sharpe ratio (−0.435) and a profit factor below 1 (0.940). No cell in the grid has a positive Sharpe ratio. The loss therefore degrades smoothly and never changes sign.
Exhibit 7
Sharpe ratio and total return across cost multipliers and entry thresholds. Sharpe is negative in every cell

5.3 Circuit-breaker attribution
The study also ran the 1-lot book with the ADF circuit breaker turned off, to see how much the stationarity gate contributed.
| Metric | Breaker on (base) | Breaker off |
|---|---|---|
| Total return | −27.84% | −27.84% |
| Sharpe ratio | −0.612 | −0.612 |
| Sortino ratio | −0.840 | −0.840 |
| Maximum drawdown | −36.00% | −36.00% |
| Profit factor | 0.871 | 0.871 |
| Number of trades | 264 | 264 |
| Final equity | $72,157 | $72,157 |
The other metrics in the headline table (annualized return, win rate, average duration, beta, alpha and R²) were also identical. The breaker blocked entries on 0.0% of tradable bars, so the Sharpe ratio it contributed is +0.000. This is different from a gate that binds only rarely. The breaker was never tested as a working safety mechanism in this sample, not even during the 2022 rate-hike period. Its protective value is therefore unverified, not shown to be small. It could mean the residual stays locally stationary through every regime in this window. It could also mean the window and threshold are too permissive to matter except in more severe disorder than gold produced in 2020 to 2025.
6. Walk-forward test (out of sample)
This test uses rolling 6-month training windows followed by 1-month test windows, moved forward one month at a time. In each fold the entry threshold is chosen from the grid 1.50, 1.75, 2.00, 2.25 and 2.50 by the best Sharpe ratio in training, and then applied unchanged to the next month, which it has not seen. Only the test months are joined together. The Kalman filter is not refitted, because it is already causal and frozen after the burn-in.
- 48 folds were run. The last fold tested July 2025.
- The threshold chosen most often was 2.25.
- The stitched out-of-sample result is shown below.
| Metric | Walk-forward out of sample |
|---|---|
| Total return | −24.46% |
| Annualized return | −6.78% |
| Sharpe ratio | −0.667 |
| Sortino ratio | −0.922 |
| Maximum drawdown | −39.65% |
| Profit factor | 0.854 |
| Win rate | 51.9% |
| Average trade duration | 25.0 bars |
| Number of trades | 216 |
| Final equity | $75,538 |
| Beta versus buy-and-hold gold | +0.0587 |
| Alpha (annualized) | −7.31% |
| Beta R² | 0.0054 |
The last 12 of the 48 folds:
| Test month | Threshold chosen | Training Sharpe | Out-of-sample P&L | Trades | Out-of-sample Sharpe |
|---|---|---|---|---|---|
| 2024-08 | 2.00 | 0.178 | +$1,096 | 3 | 0.764 |
| 2024-09 | 2.25 | 0.447 | −$2,299 | 5 | −2.012 |
| 2024-10 | 2.00 | 0.654 | +$1,416 | 6 | 0.984 |
| 2024-11 | 2.00 | −0.116 | −$9,935 | 5 | −4.682 |
| 2024-12 | 2.00 | −0.883 | −$7,391 | 2 | −5.579 |
| 2025-01 | 2.50 | −0.904 | +$1,094 | 1 | 3.034 |
| 2025-02 | 2.50 | −0.637 | −$3,699 | 3 | −2.452 |
| 2025-03 | 2.00 | −0.621 | −$2,110 | 4 | −1.191 |
| 2025-04 | 2.50 | −0.752 | +$2,109 | 4 | 0.744 |
| 2025-05 | 2.50 | −0.513 | +$3,328 | 1 | 2.861 |
| 2025-06 | 2.50 | 0.149 | +$3,254 | 1 | 5.128 |
| 2025-07 | 2.50 | 0.826 | −$4,120 | 3 | −2.046 |
The out-of-sample result does not contradict the full-sample backtest. If anything it confirms it: the out-of-sample Sharpe ratio (−0.667) is close to the full-sample figure (−0.612). Choosing the threshold from training data did not help. So the loss is not a case of over-fitting hiding a real edge, and the negative result is stable when the settings are chosen honestly. Single months swing widely, but the total over the 48 months is negative.
Exhibit 8
Walk-forward out-of-sample equity (solid) against the full-sample backtest with a fixed threshold of 2.0 (dashed)

7. Monte Carlo simulation
To see how much of the result depends on the order the trades happened in, the study resamples the 264 trades of the 1-lot book into new random sequences. It uses a circular block bootstrap. A block of 5 consecutive trades is drawn at a time, wrapping around the end of the list, so that clusters of related trades and runs of losses stay together. It builds 1,000 paths of 264 trades each, starting from $100,000. A path that reaches zero stays at zero.
| Statistic | Value |
|---|---|
| Final equity, 5th percentile | $10,392 |
| Final equity, median | $70,533 |
| Final equity, 95th percentile | $127,346 |
| Maximum drawdown, 5th percentile (worst tail) | −94.40% |
| Maximum drawdown, median | −45.78% |
| Maximum drawdown, 95th percentile (mildest) | −19.83% |
| Chance that final equity is below the starting capital | 77.9% |
| Chance of account ruin | 3.3% |
In 77.9% of the simulated histories the account ends below its start, and in 3.3% it is wiped out. The median path ends at $70,533, close to the actual result of $72,157. The worst 5% of paths end at or below $10,392, while the best 5% end at or above $127,346. The actual drawdown of −36.00% was milder than the median simulated drawdown (−45.78%). Reshuffling the trades gives a wide range of outcomes, but the typical outcome is a loss. That points to the average trade being negative, not to bad luck in the order of trades.
Exhibit 9
1,000 block-bootstrap equity paths. The median path declines and the 5th-percentile path approaches zero

8. Conclusion
The study's formal verdict is mixed. H0 is rejected statistically, because the spread does mean-revert. But the economics after realistic costs are not strong enough to call this a tradable edge.
| Question | Result |
|---|---|
| Does the residual have a unit root (H0)? | Rejected. The ADF test rejects it in 95.8% of bars, the half-life is about 12.5 hours, and the stationary scale is about $13.44 per ounce. |
| Does the strategy make money after costs? | No. Profit factor 0.871 and total return −27.84% for the 1-lot book (264 trades). |
| Is the risk-adjusted return above the risk-free rate? | No. Sharpe ratio −0.612 (Sortino −0.840). |
| Does it hold out of sample? | No. 48 walk-forward folds, Sharpe ratio −0.667, return −24.46%. |
| Does it depend little on gold's direction? | Yes. Beta +0.0353 and R² 0.0015. Alpha is −6.87% a year. |
| Does it survive the required 5-lot size? | No. The account was ruined on 2022-01-27. |
| Does it beat buy-and-hold gold? | No. −27.84% for the 1-lot book against +85.00% for gold, which is shown without trading costs. |
| How often does reshuffling the trades end in a loss? | 77.9% of 1,000 paths. |
The statistical side of the hypothesis held: the gap does come back toward its equilibrium, and the evidence for that is strong. The economic side failed. The study's own reading is that the reversion is real but too small and too slow compared with trading costs, the one-bar execution delay, and the drag from gold's strong directional trends. Almost all of the loss came from the short side. Win rate is also misleading on its own: exiting at the mean gives a high win rate, because winners are capped near the entry threshold times the residual's scale, while losers run to the stop or the time limit.
The bottom line: on this data, with realistic costs, the hourly gold mean-reversion strategy did not make money. At the required position size it did not survive.
What the study suggests testing next
These ideas are the study's own. They were not tested here. Because nearly all of the loss sits in the short leg during a period when gold trended up, re-tuning the entry threshold for both directions is unlikely to help, since the sensitivity grid never changes the sign of the result. The study suggests two things: fitting the half-life and scale separately for long and short trades instead of sharing one set of parameters, and adding a slow trend filter, such as the slope of a multi-week moving average, that turns off or shrinks the short leg during sustained uptrends. It also suggests replacing the fixed 1,250-bar, 5% ADF breaker with a stricter or regime-adaptive one, and checking that it actually fires during known regime breaks such as 2022.
Limitations
- Position size. At the required 5 lots on $100,000, the risk of a single trade is a double-digit percentage of the account, given a stationary scale of about $13 per ounce. The 1-lot reference book is what the conclusion about the edge rests on. Any real use would have to start from a position size that matches the risk, not from the required size.
- No hedge. This is a single-instrument bet with no offsetting leg. The only protection against a real trend is the circuit breaker, the Z-stop and the time stop. None of them can fully remove the risk of gaps, including gaps held over a weekend. The breaker is reactive: it needs enough new data after a break to fail the test, so the first losses in a regime change cannot be avoided.
- Data source. Everything comes from a retail broker feed, which is one venue's view of an over-the-counter market. Bar volume is a venue-local proxy, not true market volume, so the volume gate filters the feed's dead hours and not the market's. The data have no depth of book, and fills at the next open plus spread and slippage ignore queue position and the adverse selection that tends to be worst when signals fire. The spread is 0.30 USD per ounce on every bar, and the study notes that when it uses its public mirror data the bid-ask gap is an assumed constant. The 2× and 3× cost stress in Section 5.2 is the study's bound on this uncertainty.
- Frozen parameters. The Kalman noise ratio is chosen once on the first 3,000 bars and never revisited. A period with a very different noise level would need a new estimate, and this design does not make one.
- Win rate is misleading on its own. Exiting at the mean gives a high win rate by design. It should not be the number that the strategy is judged by.
- Long and short are treated alike. The loss is almost entirely on the short side, but the rule is symmetric and shares one set of parameters for both directions.
- The breaker was never tested. It blocked no entries in this five-year window, so its value as a safety mechanism is unverified.
- One five-year window. This run covers about five years. The study notes that a longer archive of about 13 years can be used by changing one setting, but it was not used here.
Research by Lanre Ibrahim. Source: XAUUSD_Kalman_OU_MeanReversion_EXECUTED_REAL notebook and XAUUSD strategy summary report. Historical tests on past data; not investment advice and not the record of any managed account.