XlfDailyZScoreMeanReversionLS
Hypotheses
XLF Short-Horizon Mean-Reversion — Long-Short, Single-Instrument US Sector ETF: Fade 2-Day Z-Score Extremes on Commission-Free Equities (the Reversion Signal That Is Fee-Dead on Crypto but VIABLE on USEQ), Regime-Biased by 200-Day Trend, Reversion/Time/ATR Exit (XLF.USEQ, Daily Bars, 3-Parameter)
Hypotheses
A LONG-SHORT, SINGLE-INSTRUMENT short-horizon mean-reversion swing on XLF.USEQ (SPDR Financials sector ETF) — a deliberate jump to a completely different INSTRUMENT CLASS and VENUE (US equities, USEQ) and a different fee REGIME from the entire crypto book. The whole reason short-horizon reversion keeps dying in this factory (338 overfit + 257 fee_edge deaths, RSI-2/z-score fades whose ~0.3-0.8% bounce is smaller than crypto's 0.10-0.20% round-trip fee) is FEES. USEQ is commission-free: costs are just spread+impact (~0.02-0.05% round-trip on a hyper-liquid sector ETF), roughly 3-5x cheaper than Binance futures and ~5-10x cheaper than crypto spot. That single change flips the economics of exactly the mechanism that is fee-dead on crypto. XLF is chosen because sector ETFs are more RANGE-BOUND than trending single-index names (SPY/QQQ), so BOTH directions revert — enabling a genuine long-short (filling the under-represented long_short bucket) rather than a drift-fighting short. Decades of daily history (XLF since 1998) give a robust multi-window walk-forward and a real holdout, unlike the short crypto-supplementary feeds that produced empty OOS windows. MECHANISM: fade daily z-score extremes of price vs a short mean; go long deeply-oversold, short deeply-overbought; bias by a 200-day trend regime so shorts are only taken when the longer regime is neutral/weak and longs when neutral/strong — avoiding fighting a strong secular drift. Only 3 free parameters (z_entry, hold_days, stop_atr_mult; trend length fixed at 200) to resist the overfitting that killed the RSI-2 variants. FEE ARITHMETIC: a typical 2-day oversold bounce in XLF is ~0.8-1.6%; capturing ~0.6% against a ~0.04% commission-free round-trip is ~15x the cost floor and far above the 0.15% viability bar — the same 0.6% capture would be marginal-to-dead on crypto after 0.10-0.20% fees. No leverage assumed beyond 1x (Reg-T 2x available but not needed for the edge).
Hypotheses
Implements the hypothesis exactly: fade daily z-score extremes on a range-bound US sector ETF where commission-free USEQ costs (spread+impact ~0.02-0.05% round trip) are 3-10x below crypto fees, so a ~0.5-1.0% two-day reversion capture clears the cost floor by a wide margin. Long-short by construction (both tails traded), single instrument, and only 3 free parameters (z_entry, hold_days, stop_atr_mult) plus the reversion window, with trend length fixed at 200 sessions, to resist the overfitting that killed the crypto RSI-2 variants. calculate_signal returns the raw continuous z-score every bar (never gated), and the entry decision lives in should_enter against a matching-unit threshold. Two deliberate implementation choices: (1) whole-share sizing and session-counted holding periods per USEQ rules; (2) the 200-session trend mean is computed over all closes available up to 200 rather than requiring a 200-bar warmup, so the strategy trades from bar 60 onward — a full 200-bar warmup would consume 210 of the ~252 daily bars in the 365-day Layer-3 sandbox window and produce near-zero trades, while in the real multi-decade backtest the trend mean is the full 200-session mean for all but the first 200 sessions. The holding-period clock is anchored on the engine position ts_opened and counted from bar timestamps, so it is identical across restarts and replays. Venue is USEQ as specified (equity venue is required for the fee argument that is the entire point of the hypothesis); leverage stays at 1.0 and sizing therefore takes no margin.
Hypotheses
no_edge_flat_zero_sharpe: XLF 2-day z-score fade produces a ~zero-Sharpe (0.070, CI [-0.284, 0.442] straddling zero), ~0.4%/yr flat equity curve over 390 trades across 28 years, with negative information ratio (-0.234) and marginal PF (1.12). The USEQ venue thesis is actually validated in the per-trade unit (avg_trade_return_pct 0.229% clears the fee/impact floor), but the signal itself carries no directional edge — base Sharpe is the ceiling and the ~225-trial optimization would only curve-fit noise into a DSR-death, not reach the promotion floor. Three parameters cannot create an edge absent from the base signal; not worth the 2-hour optimization run. The mechanism/venue class remains promising for a more range-bound or higher-dispersion USEQ target, but this specific instrument+window is a no-edge result.
Implementation
Long-short short-horizon mean reversion on XLF.USEQ daily bars. Each session it computes a z-score of the close versus a 10-session rolling mean; z <= -1.5 is bought and z >= +1.5 is shorted, with a 200-session trend mean biasing direction (longs only when price is not more than 3% below the trend mean, shorts only when not more than 3% above), so the book never fights a strong secular drift. Positions exit on whichever comes first: reversion (z back through 0), a 5-session time stop, or a 2.5x ATR stop from the entry fill. Sizing is risk-based whole shares (1% of equity risked at the ATR stop, gross capped at 95% of equity, no leverage). All per-bar work is O(1) running sums plus a Wilder ATR.
Verification Results
Optionally require a minimum fraction of trend_len before enabling the regime gate. Acceptable as-is given the multi-decade real backtest.
Verification Results
The hypothesis fixes the trend regime at a 200-SESSION mean, but the code computes the trend mean over ALL closes available up to trend_len (deque maxlen=200), so during the first ~200 sessions the regime bias uses a partial (<200) mean. The developer documents this deliberately to allow trading from bar 60 in the 365-day sandbox. In the multi-decade XLF backtest this is the full 200-session mean for all but the first 200 of thousands of sessions — negligible effect. Not a blocker.
Verification Results
Analyst: judge per-trade net edge against the ~0.02-0.05% USEQ spread floor over the full walk-forward/holdout, not the 1-year sandbox.
Verification Results
Sandbox (15 trades, 249 days) net avg_trade_return_pct = 0.0203%, below the ~0.05% USEQ spread+impact floor. This is a tiny warmup-truncated sample — a performance/edge question, not a code bug: z>=1.5 reversion to a 10-day mean implies ~0.75-1.5% gross moves on XLF daily, structurally clearing the spread. Flagged so the analyst applies the USEQ ~0.05% floor (NOT the crypto 0.15% floor) over the full multi-decade backtest.
Backtest Review
Venue thesis validated in the per-trade unit: avg_trade_return_pct 0.229% clears the USEQ fee/impact floor, unlike the crypto reversion siblings
Backtest Review
Well-measured sample: 390 trades over 28 years of clean XLF daily history, so the verdict is not sampling noise
Backtest Review
Only 3 free parameters and a real long-short balance (242 long / 148 short) — good overfitting hygiene
Backtest Review
Sharpe 0.070 with 95% CI [-0.284, 0.442] straddling zero — indistinguishable from no-skill BEFORE any optimization
Backtest Review
total_return 11.65% over ~28 years (~0.4%/yr); alpha 0.25%, information_ratio -0.234, sortino 0.054 — flat, no risk-adjusted edge anywhere in the record
Backtest Review
profit_factor 1.12 marginal; annual returns oscillate sign with no persistent edge regime
Backtest Review
impact_cost_pct 24.2% already consumes a quarter of gross PnL on a zero-Sharpe signal
Outcome Summary
XlfDailyZScoreMeanReversionLS deliberately jumped instrument class and venue — from the crypto book to commission-free XLF.USEQ — to test whether cheaper fees could revive a short-horizon reversion mechanism that repeatedly died on crypto to fee costs. The venue thesis was actually validated: over 390 trades and 28 years of clean daily history, the average per-trade return of 0.229% cleared the USEQ fee and impact floor. But the signal itself proved to have no directional edge, delivering a near-zero Sharpe of 0.070 with a confidence interval straddling zero, ~0.4%/yr of flat returns, and a negative information ratio. The analyst abandoned it at the backtest-review gate before any optimization, reasoning that three parameters could not create an edge absent from the base signal — while noting the mechanism and venue class remain promising for a more range-bound or higher-dispersion USEQ target.
Outcome Summary
Fixing the fee regime is necessary but not sufficient — a cheaper venue can make a signal's per-trade economics viable while leaving it with no underlying directional edge, and three parameters cannot manufacture an edge the base signal lacks.
Outcome Summary
The analyst issued an 'abandon' verdict at the pre-optimization backtest-review gate: the signal carried no directional edge (near-zero Sharpe with a CI straddling zero), so the ~225-trial optimization would only curve-fit noise rather than reach the promotion floor. It never advanced to optimization, analyst post-opt review, or risk review.
Outcome Summary
A long-short daily z-score mean-reversion swing on XLF.USEQ (SPDR Financials ETF), fading 2-day price extremes with a 200-day trend regime bias, betting that commission-free US equities would make the reversion edge — fee-dead on crypto — economically viable.
Outcome Summary
Across 390 trades over ~28 years of XLF history (242 long / 148 short, 57.9% win rate) it returned 11.65% total (~0.4%/yr) with a Sharpe of just 0.070 (95% CI [-0.284, 0.442]), profit factor 1.12, and information ratio -0.234; the venue thesis did hold at the trade level, with avg_trade_return_pct of 0.229% clearing the USEQ fee/impact floor.
Backtest and paper results are hypothetical. Trading involves risk of loss.