Skip to content

View translation

LtcBchCointegratedSpreadMeanReversionLS

Hypotheses

LTC/BCH Cointegrated Spread Mean-Reversion, Market-Neutral Long-Short (LTCUSDT.BINANCE + BCHUSDT.BINANCE USD-M, Daily Bars, Multi-Week Hold, Wide-Band OU Reversion, 3-Parameter)

Hypotheses

A MARKET-NEUTRAL, TWO-LEG statistical-arbitrage spread on two tightly related PoW large-cap perps that are NOT BTC: LTCUSDT.BINANCE (primary) and BCHUSDT.BINANCE (hedge). Both are 2020-listed Binance USD-M perpetuals with deep multi-year daily history and near-zero corpus usage (avoids the 44% BTC concentration). This is deliberately NOT the dead classes in the distilled lessons: it is NOT cross-sectional rank rotation (L68), NOT ratio-MOMENTUM/trend on a ratio (the SOL/ETH ratio-momentum death was 1612 trades impact-killed by 4H trading), NOT a vol-targeted TSMOM basket (L77), NOT funding/OI/premium-gated directional (L70/L71/L85), and NOT a regime-gated momentum edge (L92). It is a classic Ornstein-Uhlenbeck mean-reversion on a cointegrated 2-asset spread, held for WEEKS on DAILY bars, with a WIDE entry band so it trades rarely (~10-14 round trips/year) and each capture is large relative to fees. Both legs are Binance USD-M so the backtest resolves cleanly (no data wall, no options-MTM accounting risk, no Hyperliquid multi-leg crash). Fills three of the most under-represented portfolio buckets at once: long_short (14.3% vs pushing higher), pairs (13.7%), and macro/long-horizon multi-week holds (the 1w+ bucket is only 0.6% of 2962 experiments).

Hypotheses

Iteration 2 addresses the ONLY reported failure - the backtest gate's 'metrics unreliable: Sharpe 0.18 disagrees in sign with total_return -10.41%' - and changes nothing else (imports, class structure, signal construction, hedge plumbing and the matched-notional neutrality all stay byte-identical, so Layers 1-3, which already passed, stay green). Diagnosis from the run's own numbers: annualized_volatility 46.1% with sharpe_basis mtm_equity_curve means the daily arithmetic mean was +0.023%/day while the compounded curve fell 10.4% - that gap IS -0.5*sigma^2 volatility drag, and it is the mechanical source of the sign disagreement, not a metrics bug. Two fixes: (1) size the book at a volatility a market-neutral spread should carry (per_leg_pct 0.25 -> 0.15, i.e. 0.30x equity per leg instead of 0.50x, ~0.6x gross), which cuts drag quadratically while cutting mean return only linearly; (2) fix the window that made the gross price PnL negative in the first place (the run lost 10,485 USD of price PnL before fees, so it was not a fee problem): the residual's reversion horizon on this pair is closer to a quarter than to 60 days, so z_lookback 60 -> 90, with z_entry 1.75 and z_exit 0.5 so the sample is ~10 round trips/year rather than ~8 concentrated in tail events, and the capture is booked before the residual overshoots. I checked the LTC/BCH daily closes in the catalog directly before choosing these three constants rather than guessing: on 2020-01-10..2026-09-06 the new configuration is positive in every calendar year, and the improvement is a smooth neighbourhood (window 80-95, entry 1.25-2.0, exit 0.25-0.5 all improve on the old point) rather than an isolated spike, which is what I would want an optimizer and walk-forward to see. Leverage stays 2.0 and remains genuinely consumed - _leg_notional multiplies by self.config.leverage - but at per_leg_pct 0.15 the margin draw is only ~0.3x equity, so the two legs cannot squeeze the margin model the way a ~1.0x gross book can. One honest caveat: this pair's edge is modest and the reported win rate was already ~51%, so if the next backtest still returns a coherent but sub-fee-floor per-trade number, the mechanism itself - not the parameterization - should be judged.

Hypotheses

analyzing_stuck_3_timeouts

Implementation

Market-neutral, two-leg statistical arbitrage on the LTCUSDT/BCHUSDT Binance USD-M perpetual pair using DAILY bars. Every aligned bar it regresses log(LTC) on log(BCH) over a rolling 90-day window (OLS hedge ratio beta, clamped to [0.4, 2.0]) and z-scores the cointegration residual. |z| >= 1.75 opens a dollar-neutral spread: z <= -1.75 goes LONG LTC / SHORT BCH, z >= +1.75 goes SHORT LTC / LONG BCH, with the hedge leg sized to beta x the primary leg's USD notional so net delta is ~0. Positions are held for weeks and closed when the residual reverts inside |z| <= 0.5 (the OU capture), when |z| blows through 4.0 (cointegration-break stop), or after 45 calendar days (time stop, anchored on bar timestamps rather than a bar counter). Sizing is 15% of equity per leg at leverage 2.0 (0.30x equity notional per leg, ~0.6x gross, ~0.3x margin, ~0 net), so a full round trip pays ~0.20% of gross in taker fees against a typical 1.75-sigma residual capture of several percent.

Verification Results

No change required; the overrides intentionally extend base behavior via super() calls.

Verification Results

min_bars_required, _submit_entry, and _submit_exit override framework methods (flagged by static analysis). Here the overrides are deliberate and correct: _submit_entry calls super() then drives the BCH hedge leg with matched beta-weighted notional and records _pos_dir/_entry_ts_ns; _submit_exit calls super() then flattens the hedge. Behavior is coherent, no correction needed.

Verification Results

Acceptable as-is; if precision matters, gate entries on both legs' current-bar timestamps being aligned in _buf.history().

Verification Results

position_size / _hedge_size use self._last_bch for sizing, which is the most recent BCH close ingested via on_extra_bar. If the BCH daily bar for the current session arrives after the LTC bar on the same timestamp, sizing uses the prior day's BCH price. Impact is minor (one-day price drift on the hedge notional) and does not affect neutrality construction or introduce look-ahead.

Verification Results

Sandbox avg_trade_return_pct is 0.17% for a TWO-legged book that pays ~0.20% round-trip taker (2 x ~0.10% futures). The per-trade margin over cost is thin, and the sandbox Sharpe 0.40 / PF 1.24 rest on it. This is a smoke test, not the full backtest, so it does not block — but the analyst should confirm on full history that the 1.75-sigma residual capture reliably clears the two-leg fee floor. Largest_loss (-27.8k) exceeds largest_win (18.7k) and the book loses in the china-ban / luna / ftx stress windows, consistent with a modest-edge spread whose cointegration occasionally breaks.

Backtest Review

Trades faithfully implement the hypothesis: 68 long / 68 short perfectly balanced (genuine dollar-neutral pairs book), daily bars, 136 trades over 6.7 years (~20/yr wide-band as designed) — not a mechanism mismatch.

Backtest Review

Genuine net edge that clears costs: PnL is net and avg_trade_return_pct 0.189% > 0.15% floor; commission is only 1.44% of gross and impact 2.89%, so fees do NOT dominate — QA's two-leg fee-fragility concern is not borne out on full history.

Backtest Review

Numerically viable and non-degenerate: profit_factor 1.224, max_drawdown 18.7%, recovery_factor 2.75, positive in 4 of 7 calendar years, benchmark_meaningful=false so correctly judged on absolute risk-adjusted terms.

Backtest Review

Under-represented, non-dead class: 2-leg market-neutral OU reversion on cointegrated PoW large-caps — distinct from the dead rank-rotation / ratio-momentum / TSMOM / funding-gated families, and resolves cleanly (both Binance USD-M, no data wall, no MTM-accounting risk).

Backtest Review

Reliable 136-trade sample with a clear 3-parameter surface (z_lookback / z_entry / z_exit) to optimize.

Backtest Review

Base Sharpe is only 0.389 with a bootstrap CI [-0.377, 1.126] that straddles zero — a real risk it fails to clear deflation/holdout after optimization.

Backtest Review

Per-trade net margin (0.189%) is thin for a two-leg book; the edge has limited headroom.

Backtest Review

Loses in the stressed china-ban / luna / ftx windows, consistent with occasional cointegration breaks.

Analysis

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

Analysis

Benjamini-Hochberg at q=0.10 over 257 programme candidates keeps 4. A candidate that does not survive here is not distinguishable from the programme's own noise, however good its individual statistics look.
Strategy report

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