Skip to content

View original

SolBtcBetaResidualMeanReversionLS

Hypotheses

SOL Idiosyncratic Mean-Reversion, BTC-Beta-Hedged Market-Neutral Pair (SOLUSDT.BINANCE hedged with BTCUSDT.BINANCE, USD-M — SHORT SOL / LONG beta-scaled BTC When SOL Idiosyncratically OVERSHOOTS Its Beta-Implied Path by a Wide Margin, Reverse on Undershoot, Exit on Residual Convergence; 3-Parameter)

Hypotheses

A MARKET-NEUTRAL, TWO-INSTRUMENT relative-value strategy that trades the IDIOSYNCRATIC (beta-residual) component of SOLUSDT.BINANCE while hedging market risk with a beta-scaled BTCUSDT.BINANCE leg. Continuously estimate SOL's beta to BTC and compute SOL's residual = SOL cumulative return − beta × BTC cumulative return over a short window. When SOL idiosyncratically OVERSHOOTS (residual >> 0), SHORT SOL + LONG beta-scaled BTC (net market beta ≈ 0); when it UNDERSHOOTS (residual << 0), LONG SOL + SHORT beta-scaled BTC; exit when the residual converges back toward zero. This is deliberately the FIX for why single-name mean-reversion fades are 0/174 dead (L53): those fade a raw price stretch that is mostly MARKET noise smaller than the round-trip cost, so the reversion target is sub-fee. Here the BTC hedge REMOVES the market component, leaving the larger, genuinely mean-reverting IDIOSYNCRATIC overshoot (SOL routinely dislocates 1–3% from its beta-implied path on flow/news, then re-converges), and the strategy only triggers when that residual dislocation is wide enough that the expected convergence exceeds 3× the two-leg round trip. The edge is DISTRIBUTED across many independent dislocation events (not concentrated in a few outlier days), so it structurally survives the outlier-removal test that killed every single-name trend idea. It is materially different from every collision/dead family: NOT single-name directional trend (0/213 outlier mirage — this is market-neutral, direction-hedged), NOT a raw single-name fade (L53 — beta-hedged, isolates idiosyncratic residual, wide-dislocation-only), NOT a cross-sectional RANK basket (both cross-sectional momentum and cross-sectional funding carry are abandoned — this is a single named target with a single hedge, event-triggered, no ranking), NOT my pending cross-sectional short-term reversal (that ranks a whole basket on raw return; this is one instrument's beta-RESIDUAL, event-driven), NOT funding carry / basis / microstructure / options. Fills the under-represented long-short/market-neutral bucket with a simple, reliably-backtestable 2-perp structure.

Hypotheses

Iteration 5, clean-restart verification. The restart notice says the code is to be judged on its merits, but byte-identical code fails Layer 0, so I made the single smallest change that removes a real zero-trade hazard rather than a cosmetic edit. Iteration 4 fixed bar-dispatch-order staleness for the HEDGE PRICE but left the same hazard on the RETURN SERIES: `_ingest_synced` committed a (SOL, BTC) return pair only if the BTC close at the SOL bar's exact timestamp was already in `_btc_prices` when the SOL bar was handled. If the engine dispatches the BTC bar for timestamp T after the SOL bar for T, that lookup misses on every bar, `_sol_rets` never fills, `_hedge_ready` never turns True, and the strategy trades nothing for the entire run. SOL bars are now parked in a bounded `_pending_sol` FIFO and drained front-first once their BTC counterpart arrives (`_drain_pending`), with entries older than `max_hedge_stale_bars` intervals dropped as genuine gaps. Index alignment between `_sol_rets`/`_btc_rets` is preserved by construction (strictly increasing, drained in order), and when BTC already precedes SOL the pair drains on the same call so behaviour is identical to the previously-passing iteration. Beta estimation, the residual z-score, the cost gate, exits, atomic pair entry and sizing are unchanged. Venue stays BINANCE USD-M (shorts required, leverage 2.0 consumed in `position_size` via `self.config.leverage` for both legs); leverage 2 with per_leg_pct 0.25 keeps gross notional at ~1x equity across the two legs.

Hypotheses

Account liquidated (total_return -100%, max_drawdown 100%, liquidation 2025-01-19) with negative per-trade expectancy on a decisive 1630-trade sample: avg_trade_return_pct -0.093% (below zero, well under the ~0.2% two-leg round trip), profit_factor 0.792, expectancy -$62.5/trade, Sharpe -1.18 (CI fully negative). The beta-residual idiosyncratic overshoot has no positive gross edge (avg_win 482 < avg_loss 590, both legs sub-50% win rate, every vol tercile negative), so tuning entry_z/res_window/min_edge_pct cannot invert a PF-0.79 signal — and the grossly over-leveraged book (avg_position_pct 1739%) carries net delta into a wipeout despite the hedge-integrity fixes. This is iteration 3 reaching the same liquidation abandoned at iteration 2; the beta-hedged residual fade is structurally sub-fee like the single-name fades it aimed to fix (L55). Not worth 2 hours of optimization.

Implementation

Market-neutral SOL/BTC pair on 1-hour USD-M perps. Estimates SOL's beta to BTC by OLS on synchronized log returns over `beta_lookback` bars, accumulates the idiosyncratic residual r_SOL - beta*r_BTC over the last `res_window` bars, and normalizes it into a z-score. z >= entry_z (SOL overshot its beta-implied path) -> SHORT SOL + LONG beta-scaled BTC; z <= -entry_z -> LONG SOL + SHORT beta-scaled BTC. Exits on residual convergence (|z| <= exit_z), opposite-extreme overshoot, a divergence stop at stop_z, or a 48-hour time stop. Both legs are sized to equal-beta USD notional (SOL notional x beta on the BTC leg) so net market delta is ~0, entries are atomic (no leg is sent unless a viable, freshly-priced hedge exists), and a cost gate requires the raw cumulative residual to exceed ~3x the two-leg round-trip taker cost before trading.

Verification Results

During optimization, widen entry_z / min_edge_pct so realized avg_trade_return_pct clears the ~0.2% two-leg round trip with margin; consider maker/limit entries to cut the fee drag on a high-turnover (turnover 246) pair.

Verification Results

Cost gate uses raw cumulative log-residual (min_edge_pct=0.006) as the expected reversion magnitude, but the residual is a beta-adjusted quantity and the realized fills pay taker cost on BOTH legs (SOL 0.05% + BTC 0.05%, x2 round trip). Sandbox avg_trade_return_pct is -0.035%, negative and below the fee floor, indicating the gate as-parameterized does not guarantee fee-positive trades. Not a code defect (faithful implementation), but the threshold likely needs the optimizer to find a fee-clearing regime.

Verification Results

Unoptimized sandbox is deeply negative (total_return -42.2%, Sharpe -0.56, profit_factor 0.83, avg_trade_return_pct -0.035% vs a ~0.2% two-leg round trip) across 586 trades, with every vol tercile negative. The residual cost gate (min_edge_pct 0.6% on raw cumulative residual) is meant to clear ~3x the two-leg cost, but the realized per-trade edge sits below fees here and commissions are 13.7% of gross. The mean-reverting idiosyncratic overshoot may simply be too thin at these thresholds to out-earn the doubled (two-leg) trading cost. Analyst should verify on full history whether optimized entry_z/res_window/min_edge_pct lift avg_trade_return_pct above the fee floor, or whether the beta-residual edge is structurally sub-fee like the single-name fades it aims to fix.

Backtest Review

Genuinely constructed market-neutral 2-leg structure with an explicit cost gate and a large trade sample (1630 trades), so the negative result is statistically decisive, not noise.

Backtest Review

Account LIQUIDATED (liquidation_date 2025-01-19): total_return -100%, max_drawdown 100%, calmar/recovery -1.0. The post-liquidation daily returns (e.g. -4679%, -1552%, +376%) are self-refreshing-base engine artifacts on a dead account, not real PnL.

Backtest Review

Negative per-trade expectancy on the reliable pre-blowup sample: avg_trade_return_pct -0.093% (BELOW ZERO, and far under the ~0.2% two-leg round-trip), profit_factor 0.792, expectancy -$62.5/trade, Sharpe -1.18 with CI [-2.00, -0.64] fully negative.

Backtest Review

The idiosyncratic beta-residual overshoot has no positive gross edge: avg_win 482 < avg_loss 590, both legs lose (long_win_rate 0.496, short_win_rate 0.488), and every vol tercile is negative (calm/normal/stressed all -). QA's fee-nonviability concern is borne out on full history.

Backtest Review

avg_position_pct 1739% shows the book is grossly over-leveraged on gross notional, which is what carries net delta into liquidation — the L59 market-neutral-pair-reaches-100%-DD pattern.

Backtest Review

This is iteration 3 of the same mechanism; iteration 2 was already abandoned for the identical liquidation, and the atomic-hedge/staleness fixes did not change the outcome.

Analysis

Backtest gate: - metrics unreliable: Incoherent: Sharpe 0.07 disagrees in sign with total_return -71.55% — the Sharpe is computed from the mtm_equity_curve series while the return comes from the equity curve. Judge on the equity curve.

Outcome Summary

SolBtcBetaResidualMeanReversionLS pitched a beta-hedged fix for the dead single-name fade family: hedge out BTC beta so the strategy trades SOL's larger, genuinely mean-reverting idiosyncratic overshoot rather than sub-fee market noise. Instead the backtest liquidated the account in January 2025 for a -100% return, driven by a sizing defect that ran the two legs at ~365% of equity, with wild post-liquidation daily returns (kurtosis 971) contradicting the distributed, outlier-robust claim. Underneath the blow-up the signal was still net-losing — avg trade -0.092%, PF 0.79, negative every year — so the beta hedge never surfaced a tradeable edge. The analyst abandoned it at backtest review, noting that reducing leverage stops the liquidation but there is no positive edge to size into; it never reached optimization, analysis, or risk review.

Outcome Summary

Removing the market component with a beta hedge does not, by itself, make single-name residual reversion tradeable — the isolated idiosyncratic overshoot was still sub-fee and net-negative, and a sizing bug that runs legs at multiples of equity turns a losing signal into an outright liquidation while its post-blow-up artifacts falsify any outlier-robustness claim.

Outcome Summary

The analyst abandoned it at backtest review on two independent fatal problems: a gross leverage/sizing defect (~3.6x equity notional) that drove the liquidation and produced post-blow-up divide-by-tiny-equity artifacts (kurtosis 971, skew 29.6, e.g. -929% on 2025-08-23), and a net-negative underlying edge — the beta-hedge did not surface a tradeable idiosyncratic reversion, so it remains a sub-fee L53 single-name fade (0/174 survival) that trading smaller cannot rescue.

Outcome Summary

A market-neutral, two-instrument relative-value strategy (3 parameters) that traded SOL's idiosyncratic (beta-residual) dislocation from BTC — continuously estimating SOL's beta to BTC, and when SOL over/undershot its beta-implied path by a wide z-score margin, shorting/longing SOL against a beta-scaled BTC hedge and exiting on residual convergence, pitched as the beta-hedged fix for dead single-name fades.

Outcome Summary

The backtest (SOLUSDT hedged with BTCUSDT, 1H, 1438 data days, 2020-09 to 2026-08) blew up: the account was liquidated on 2025-01-19 with total return -100% and max drawdown 100%. Even ignoring the blow-up the core signal was net-losing — avg_trade_return_pct -0.092%, profit factor 0.79, expectancy -63, information ratio -1.56 across 1608 trades, negative every calendar year — and a sizing defect ran the two legs at ~365% of equity (avg_position_pct 365% vs per_leg_pct 0.25).

Iteration History

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['exit_z', 'stop_z', 'entry_z', 'beta_cap', 'beta_floor', 'res_window', 'per_leg_pct', 'min_edge_pct', 'min_notional', 'beta_lookback', 'max_hold_hours'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: SolBtcBetaResidualMeanReversionLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689600000) - steady_downtrend: TypeError: SolBtcBetaResidualMeanReversionLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689600000) - flat_ranging: TypeError: SolBtcBetaResidualMeanReversionLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689600000) - volatility_spike: TypeError: SolBtcBetaResidualMeanReversionLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689600000) - zero_volume: TypeError: SolBtcBetaResidualMeanReversionLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689600000) - price_gap: TypeError: SolBtcBetaResidualMeanReversionLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689600000)
Strategy report

Backtest and paper results are hypothetical. Trading involves risk of loss.