Skip to content

View translation

EthBtcRatioTrendMarketNeutralLS

Hypotheses

ETH/BTC Ratio Trend, Market-Neutral Long-Short Pair (Long ETHUSDT.BINANCE / Short BTCUSDT.BINANCE USD-M When the ETH-over-BTC Ratio is Trending Up, Reverse When Trending Down, Daily Bars, Zero-Cross with Deadband, 2-Parameter)

Hypotheses

A DOLLAR-NEUTRAL, TWO-INSTRUMENT relative-value TREND strategy that trades the ETH/BTC price RATIO as its own instrument on daily bars, using BINANCE USD-M perpetuals so both legs can be shorted. This is deliberately NOT another single-name absolute-momentum clone (the one surviving family, now saturated across BTC/ADA/SOL/AVAX/NEAR/etc.) and NOT a cointegration/mean-reversion pair (LtcBchCointegratedSpread died): it is the crypto complex's single most persistent RELATIVE trend — capital rotating between the two largest assets ('alt-season' vs 'BTC-dominance' regimes). The ratio R = P(ETH)/P(BTC) trends for weeks at a time; we ride the trend in the SPREAD, not the direction of crypto. Because the book is beta-neutral to the whole complex, it should make money in exactly the vol-stressed / crash windows where directional trend books lose (a genuine regime-diversifier for the portfolio, whose entire long-short survivor set is single-name directional). Only 2 parameters (lookback, deadband) to resist the overfit that killed 380 prior hypotheses. Primary = ETHUSDT.BINANCE, hedge = BTCUSDT.BINANCE, dollar-matched legs (equal USD notional each side => ~zero net crypto beta by construction; residual beta from ETH's ~1.1 beta to BTC is small and further trimmed by the neutral sizing).

Hypotheses

Iteration 2 targets the incoherent-metrics failure (Sharpe +0.31 vs total_return -11.24%): a positive mean daily mark-to-market return with a negative compounded equity curve is volatility drag, and the drag source here was a structural leg-desynchronisation bug. The old should_enter required the BTC hedge to already appear in cache.positions_open before allowing the ETH entry, but the hedge market order is submitted on the same bar and only fills on the NEXT bar - so every entry ran a fully NAKED directional BTC leg for a whole daily bar before the ETH leg went on. That injected raw crypto beta and its variance into a book that is supposed to be beta-neutral, inflating mtm volatility (drag) while the realized equity curve bled. Fix: track the submitted-but-unfilled hedge as a pending direction (_hedge_pending, expiring after 2 bars if it never fills) and accept it in should_enter, so both legs are submitted on the same bar and fill together; plus a should_exit safety that flattens the ETH leg if the mirrored hedge ever goes missing, so the book can never carry a one-legged directional position (lesson L59). Leg_fraction was trimmed 0.35 -> 0.30 (gross 1.2x equity at leverage 2.0, which the sizing consumes via self.config.leverage) to further cut compounding drag. Signal logic, imports, class structure and the deadband state machine that passed Layers 1-3 are unchanged.

Hypotheses

analyzing_stuck_3_timeouts

Implementation

Dollar-neutral ETH/BTC ratio-trend pair on Binance USD-M daily bars. Signal = 100*ln(R_t/R_{t-lookback}) where R = P(ETHUSDT)/P(BTCUSDT), computed every bar. A zero-cross-with-deadband state machine goes long-spread (long ETH / short BTC) when the ratio trend exceeds +deadband, short-spread when it falls below -deadband, and flat on the zero cross. Both legs are sized to identical USD notional (equity * leg_fraction * leverage) so the book carries ~zero net crypto beta and expresses only the ETH-over-BTC rotation. Two signal parameters (lookback, deadband).

Verification Results

Optionally require both same-ts closes to be present before computing/acting on the signal for that bar, to guarantee ETH and BTC are always sampled at the identical instant.

Verification Results

On a shared close-timestamp, if the ETH primary bar is dispatched before the BTC extra bar, calculate_signal falls back to _hedge_last (the prior day's BTC close), so the ratio mixes today's ETH close with yesterday's BTC close for that bar. This is conservative (never future-peeking) but introduces a one-day staleness in the ratio depending on intra-timestamp dispatch order. The lookback-trend signal is robust to this, so it is not a correctness failure.

Verification Results

Verify the base template calls the subclass min_bars_required for warmup gating; rename if the override is not honored.

Verification Results

min_bars_required overrides a framework method (static-analysis base_shadow warning). Appears intentional (returns lookback+2 to gate warmup) and behaves correctly, but confirm the base template honors the override rather than its own implementation.

Verification Results

Sandbox is a smoke test but two things are worth carrying to the analyst: (1) regime attribution shows the 'normal' vol tercile at -30.4% return / -0.02 Sharpe while all PnL comes from calm (+28.5%) and stressed (+38.9%) terciles — the market-neutral diversifier thesis holds in stress (good) but the book bleeds in the middle regime, so full-history edge is regime-lumpy; (2) max_drawdown 49.6% with a 1381-day drawdown-duration and Sharpe CI [-0.40, 1.06] straddling zero — the point estimate (Sharpe 0.33, PF 1.04) is marginal and not yet skill-distinguishable. Also note leg sizing is equal-USD-notional (dollar-neutral), which is what the hypothesis specifies, but ETH carries ~1.1 beta to BTC so a small residual long-beta remains by construction — the hypothesis acknowledges this. None of this blocks; the optimizer/full backtest decides.

Backtest Review

avg_trade_return_pct 0.537% is ~3.5x the 0.15% Binance USD-M fee floor on a two-leg basis; commission is only 1.71% of gross and impact 12.8% of gross, so this is NOT a fee-fragility case — the gross edge clears costs.

Backtest Review

Adequate, decisive sample: 198 trades (99 long-spread / 99 short-spread, balanced) over 6.7 years of daily bars; entry_diag shows 99 signaled = 99 submitted with both legs synchronized on the same bar.

Backtest Review

Code faithfully implements the stated hypothesis — dollar-neutral ETH/BTC ratio-trend with a zero-cross+deadband state machine, benchmark_meaningful correctly false, positive expectancy (+$100/trade).

Backtest Review

Genuinely differentiated mechanism (relative-value ratio trend, market-neutral) with only 2 signal parameters and a large unexplored region; not a saturated single-name momentum clone (L82/L93) nor a cross-sectional dollar-neutral basket (L45). Regime attribution confirms the diversifier thesis in stress (calm +20.6%, stressed +16.8%).

Backtest Review

profit_factor 1.029 is thin and sits in the fee/impact drag band; payoff ratio only 1.07 (avg_win 7198 vs avg_loss 6716) with 0.49 win rate is a weak trend-follower distribution — a real trend book wants big asymmetric winners.

Backtest Review

Sharpe 0.343 with CI [-0.44, 1.08] straddling zero — point estimate not yet skill-distinguishable.

Backtest Review

max_drawdown 49.5% with a 1381-day (3.8yr) drawdown duration on a book that is supposed to be a diversifier; whole positive return is carried by 2022 and 2025 spikes.

Backtest Review

Regime-lumpy and time-lumpy: loses in the 'normal' vol tercile (-12.9%) and in 3 of 7 calendar years, including back-to-back 2023 (-21%) and 2024 (-26%). QA's regime-lumpiness and marginal-point-estimate concerns are borne out on full history.

Analysis

Backtest gate: - metrics unreliable: Incoherent: Sharpe 0.31 disagrees in sign with total_return -11.24% — 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 253 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.