Strategies
Gold-Miner Underreaction to Bullion: Beta-Hedged GDX-vs-GLD 3-Day Residual Catch-Up, Long-Short (USEQ 1-DAY, 2 instruments, fixed 4-session clock)
Outcome: Abandoned
GdxGldBetaHedgedResidualCatchUp
Outcome Summary
GdxGldBetaHedgedResidualCatchUp tested whether gold miners catch up with bullion moves, using a beta-hedged GDX/GLD pair on daily USEQ bars. After 2 iterations, the full 2008-2024 backtest produced 221 entries averaging -0.040% per trade, with Sharpe 0.10, profit factor 1.027, a 27% max drawdown and a drawdown lasting 3537 days. The executed z-signal had a negative IC (-0.089), and the short-GDX side won only 46% of trades. The analyst abandoned it at backtest review as having no edge after fees, so optimization, risk review and promotion were never reached.
Hypothesis
The venue, scope and direction mix is chosen against the quotas: BINANCE is 63% and long-only 84%, while USEQ, pairs and long-short are under-represented. Daily US ETF history from 2006 gives ~20 years, which avoids the short-history deflation problem that kills Hyperliquid and OKX runs, and the data coverage was checked directly in the catalog. The mechanism is a fundamental-linkage lead-lag, not momentum, funding gating, options, grids, calendar windows or a cross-sectional reversal basket. Point-in-time pre-study numbers are in the description. Only 3 economically motivated parameters are tunable.
Negative expectancy on a reliable sample: 221 beta-hedged GDX/GLD entries over 2008-2024 averaged -0.040% per trade, against a USEQ floor of 0.05% (two legs, so the effective cost floor is about 0.10%). PF is 1.027, Sharpe 0.10 with a CI of [-0.38, 0.59], max drawdown 27%, and impact takes 45% of gross. The executed z-signal has IC -0.089 (t=-2.3), so the pre-study's +0.36% to +0.60% forward residual does not appear in tradable form. QA's edge concern is borne out. Optimizing entry_z (z of 2.0 roughly halves the event count) cannot lift a negative per-trade edge above a two-leg cost floor. Classification: fee_edge/no_edge on the first measured report. If the mechanism is re-proposed, test it point-in-time first and check whether the long-only 'miners lag' side (58% win rate) carries a residual above about 0.20% per pair after impact.
Implementation
A beta-hedged trade on daily US ETF bars: gold-miner ETF GDX against gold ETF GLD, catching up on the miners' residual over a few sessions. Each close it computes gap = beta_250(t-1) x GLD's k-day log return minus GDX's k-day log return, then z-scores the gap against its last 250 values. If z > +entry_z it buys GDX and shorts beta x GLD; if z < -entry_z it shorts GDX and buys beta x GLD. A position closes after a fixed hold_sessions count, or at the bar close if the pair loses 5%; a 1-session cooldown follows. The GDX leg is 35% of equity and the GLD leg is beta times that. Total exposure is scaled to stay within the config leverage of 2x (US margin limit).
Fixes the iteration-1 leverage_set_but_unused failure. The cap on total exposure in _leg_scale now reads self.config.leverage directly. Before, it read it through getattr, which the static check could not see. The 2x leverage really changes the result: total exposure is 0.35 x (1 + beta), which goes above 1x equity when beta is over about 1.86. The median beta is 1.79, so that is roughly half of all entries, and at beta_max = 3 it reaches 1.4x. With 1x leverage those hedges would be shrunk; with 2x they are taken in full. 1.4x is under the US equity venue cap of 2.0. leg_notional_pct stays at the plan's fixed 0.35, so its meaning is unchanged. No signal, entry or exit logic changed.
Verification Results
Skip entry on any bar where an orphan GLD close was just submitted. Also check, before submitting GLD, that the GDX entry was actually accepted, for example by confirming the in-flight entry exists after super()._submit_entry.
Orphan GLD cleanup runs inside calculate_signal and submits a close. On that same bar should_enter can fire and send a new GLD entry while the orphan close is still pending. On a netting account the two orders net out, so the result should stay correct, but the orphan path itself only arises if the GDX entry was dropped (market not ready or an entry already in flight) after the GLD order went out.
Acceptable as written. A bracket order cannot express a stop on the hedged pair's P&L.
The 5% pair stop is checked only at the bar close on daily bars, so overnight gaps can produce losses beyond 5% of the GDX notional. The worst case is about 1.75% of equity per pair at stop level, with more on gaps. The hypothesis states no stop, so this is not a mismatch.
Sandbox (1653 sessions, unoptimized): PF 1.05, Sharpe 0.14, avg_trade_return_pct 0.055% per leg. That is barely above the ~0.05% USEQ spread floor. Modelled impact is 31.8% of gross, and short-GDX trades win only 42% against 64% for long-GDX. The pre-study showed +0.36% to +0.60% per signal at z 1.5, yet the realized per-leg return is much thinner. Check first whether higher entry_z (the pre-study had +0.87% to +1.02% at z 2.0) survives impact, and whether the short side carries any edge.
Backtest Review
- Sharpe
- 0.10
- Total return
- 8.07%
- Max drawdown
- 27.02%
- Trades
- 442
- Win rate
- 52.0%
- Profit factor
- 1.03
The sample is adequate: 221 pair entries (442 legs) over 2008-2024, about 15.5 years, with clean input audits and reconciled accounting.
The mechanism is wired as hypothesized: it trades both directions and the GLD hedge is sized at beta, so this is not a code or mechanism mismatch.
Long-GDX entries win 58% of the time, so the 'miners lag bullion' side may carry a weak residual.
avg_trade_return_pct is -0.040%, against a USEQ floor of 0.05% (preferred 0.10%; a 2-leg pair pays roughly double the spread). It is negative, not just thin.
Profit factor is 1.027, Sharpe 0.10, the bootstrap CI is [-0.38, 0.59] and PSR is 0.58. On 15 years of data this cannot be told apart from zero.
Max drawdown is 27.0%, against a hypothesis default of 15% for equities. The longest drawdown lasted 3537 days, so the strategy effectively never recovered after 2013.
Modelled impact is 45% of gross PnL, and capacity is only about $0.49M.
The executed forecast's IC is -0.089 (t=-2.3). The z-signal leans the wrong way over the 6-bar horizon, which contradicts the pre-study's +0.36% to +0.60% forward residual.
Short-GDX entries win only 46%. The 'miners overshoot' leg loses money.
Regimes: calm Sharpe -0.86 (-18.8%), stressed Sharpe 0.07. Positive years are 9 of 16, and 2013 alone (+18.6%) carries most of the total return.
QA's edge concern is confirmed by the full-history run, and the full history is worse: per-trade return is -0.04%, not +0.055%.
> 0 and CI excluding 0
Iteration History
Verification failed (leverage_set_but_unused): config sets leverage=2.0 but the strategy never references leverage in sizing. Size positions on it — notional = equity * fraction * leverage / price (read self.config.leverage) — or set leverage=1.0. As written the leverage is inert and the backtest is identical to 1x.
Outcome Summary
A forward-residual pre-study does not prove a tradable edge on a two-leg pair; test the signal point-in-time with costs first, and if the idea is retried, check whether the long-only 'miners lag' side (58% win rate) clears about 0.20% per pair after impact.
At backtest review, before optimization, the analyst voted to abandon. Per-trade expectancy was negative against a USEQ floor of 0.05% (about 0.10% effective for two legs), and the pre-study's +0.36% to +0.60% forward residual did not appear in tradable form, which confirmed QA's concern about the edge.
A beta-hedged GDX-vs-GLD pair trade on USEQ daily bars that bet gold-miner equities underreact to bullion moves: it went long or short GDX against beta x GLD when the z-scored 3-session residual gap passed ±1.5, and held for a fixed 4 sessions.
Over 2008-2024 it made 221 pair entries (442 legs). Average trade return was -0.040% of notional, Sharpe 0.10 (CI [-0.38, 0.59]), profit factor 1.027 and max drawdown 27.0%; modelled impact took 45% of gross PnL and the executed signal's IC was -0.089 (t=-2.3).
Backtest and paper results are hypothetical. Trading involves risk of loss.