DotKsmCointegratedSpreadMeanReversionLS
Hypotheses
DOT/KSM Cointegrated Spread Mean-Reversion, Market-Neutral Long-Short (DOTUSDT.BINANCE + KSMUSDT.BINANCE USD-M, Daily Bars, Z-Score Entry/Exit, Half-Life-Gated, 3-Parameter)
Hypotheses
A MARKET-NEUTRAL statistical-arbitrage pairs trade on two assets with a genuine structural tether: Polkadot (DOT) and its canary network Kusama (KSM). Kusama is Polkadot's pre-production chain built on the same Substrate codebase, shares the governance/parachain/runtime-upgrade cadence, and its token's value is driven by the SAME parachain-slot-auction and staking demand cycle as DOT. That shared-origin economic linkage is the crypto analog of the LTC/BCH Bitcoin-fork tether — the kind of relationship that produces a genuinely STATIONARY log-price spread rather than a spurious correlation. This is NOT a momentum/trend mechanism: it is mean-reversion of a cointegrated residual. It is deliberately a DIFFERENT FAMILY from the dual-timeframe momentum-confluence recipe that collided with my prior proposal (that idea bets on trend continuation; this bets on the spread snapping back to its equilibrium). Direction is long_short/market-neutral, filling the under-represented direction bucket, and the pair is completely untried in the factory (the tried/pipeline set covers single-name momentum on ADA/AVAX/BNB/BTC/ETH/LTC/NEAR/SOL/DOT/DOGE and an LTC/BCH spread; DOT/KSM as a cointegrated spread does not appear).
Hypotheses
Iteration 2 addresses the backtest gate's finding that the equity curve lost 19.77% while the mark-to-market Sharpe sat at ~0 — the signature of a book whose measured spread reverts but whose realized PnL does not. Three targeted changes, all downstream of layers that already passed (imports, class structure and the continuous z-score signal are untouched): (1) THE FIX — beta, the residual mean and the residual sigma are now frozen at entry and the open position is marked against that frozen spread (_z_held). Previously all three were re-estimated every bar on a rolling 60-day window, so a slowly drifting spread always appeared to have 'reverted' to a moving mean while the book, whose leg notionals were fixed at the entry beta, had not — the exit trigger and the PnL referred to different objects. (2) Tail-loss control: z_stop 4.0 -> 3.0 and max_hold_days 45 -> 21 (about 5 half-lives at the ~4-day median), so a spread that stops reverting is cut instead of being carried as a directional bet for 11 half-lives. (3) Entry timing: the dislocation must be shrinking (|z_t| < |z_t-1|, same sign) before entering, so the strategy stops stepping in front of still-widening divergences. per_leg_pct 0.25 -> 0.15 cuts gross exposure to 0.30x equity, which reduces market-impact cost on the thin KSM perp book (impact scales super-linearly in clip size) and the volatility drag that turns a zero-mean daily series into a negative compounded return. Entry frequency: the half-life gate passes ~99% of bars and the turning filter only delays an entry by a bar or two, so the design still fires roughly 40-60 round trips over the daily history — well above the >=1 trade the sandbox needs. Venue stays BINANCE USD-M at leverage 1.0 because the strategy shorts one leg (spot cannot) but needs no margin amplification: gross notional stays below equity, so the market-neutral book cannot be liquidated by a market move.
Hypotheses
Negative expectancy on a decisive 144-trade / 6.05-year sample: profit_factor 0.895 (<1, gross-negative before costs — commission is only 1.82% of gross), expectancy -$72.68/trade, total_return -10.43%, Sharpe -0.082 with CI [-0.99, 0.63] straddling zero. This is NOT fee-fragility (the signal is gross-flat/negative), so no parameter tuning can lift it above costs. The DOT/KSM residual is not tradeably stationary: the book loses in all three vol terciles (calm/normal/stressed) and in the majority of calendar years, with the sole positive year (2024) carried almost entirely by a single outlier day (2024-11-24 +14.3%). The code correctly implements the cointegration-mean-reversion mechanism, so this is a fair test and the premise is falsified, not a fixable bug — matching the LTC/BCH and ETH/BTC cointegrated-spread failures and L55. QA's sandbox fee-fragility concern is borne out and worse on full history. Not worth 2 hours of optimization. abandon_class = negative_expectancy.
Implementation
Market-neutral statistical arbitrage on the DOT/KSM cointegration residual using daily Binance USD-M perpetual bars. A rolling OLS of log(DOT) on log(KSM) gives a hedge ratio beta and a residual e = log(DOT) - beta*log(KSM); the z-score of that residual over the same window is the continuous signal. Entries are taken when |z| exceeds z_entry, the residual's AR(1)-implied half-life sits inside [1, 90] days (the stationarity gate that makes this a cointegration trade rather than a bare z-score trade), and the dislocation is turning rather than still widening. Long the residual = long DOT / short KSM at beta-matched USD notional; short the residual is the mirror. The hedge ratio and residual mean/sigma are FROZEN at entry, so the open position is marked and exited against the spread it actually holds. Exits: reversion inside z_exit, a cointegration-break stop at |z| >= z_stop, or a 21-day calendar time stop (~5 half-lives).
Verification Results
No change required; overrides are intentional and correctly chain super().
Verification Results
min_bars_required, _submit_entry, and _submit_exit override framework methods (static analyzer base_shadow warnings). The overrides are deliberate and correct here: min_bars_required returns z_lookback+5 for warm-up, and the _submit_entry/_submit_exit overrides call super() first then drive the KSM hedge leg and freeze/clear the traded-spread state. No behavioral defect.
Verification Results
Sandbox smoke test is fee-fragile: avg_trade_return_pct 0.020% is far below the ~0.20% round-trip cost of a two-leg USD-M futures pair (0.05% taker x 4 fills), profit_factor 0.896, total_return -10.43%, Sharpe -0.08 (CI [-1.05, 0.60] straddles zero), and commission is only 1.8% of gross meaning the signal is roughly gross-flat rather than fee-eaten. This is the same signature as the LTC/BCH cointegrated-spread pair (daily-bar mean-reversion of a cointegrated-but-possibly-drifting crypto pair). The iteration-2 frozen-spread fix is a genuine correctness improvement, but the analyst should verify on full-history optimization whether the DOT/KSM residual is actually stationary and whether the per-trade reversion (z 1.75 -> 0.5 x residual sigma) clears the two-leg cost with margin. Advisory only.
Backtest Review
Code is a fair, correct test of the hypothesis: 72 signals = 72 submissions, balanced 72 long / 72 short legs, beta-matched neutral sizing, frozen-spread exit (iteration-2 fix works), half-life stationarity gate, restart-safe time stop. Trades implement the stated cointegration-mean-reversion mechanism.
Backtest Review
Genuinely differentiated family/direction (market-neutral pairs) and untried pair.
Backtest Review
Negative expectancy on a decisive 144-trade / 6.05-year sample: profit_factor 0.895 (<1 = gross-negative BEFORE costs), total_return -10.43%, expectancy -$72.68/trade, Sharpe -0.082 with CI [-0.993, 0.626] straddling zero, Sortino -0.11, recovery_factor -0.41, CAGR -1.93%.
Backtest Review
avg_trade_return_pct 0.020% is ~10x below the ~0.20% round-trip cost of a two-leg USD-M pair — but commission is only 1.82% of gross, so this is a gross-flat/negative signal, NOT fee-fragility. No parameter tuning can lift an edge that is below zero before costs.
Backtest Review
The residual is not tradeably stationary: the book LOSES in all three vol terciles (calm -1.51%, normal -4.94%, stressed -5.07%) and in the majority of calendar years (2021 -22.7%, 2022 -4.8%, 2026 -2.1%). The only positive year, 2024 (+13.5%), is almost entirely one outlier day 2024-11-24 (+14.3%, driving the +12.2% Nov-24 month) — strip it and the strategy is negative everywhere.
Backtest Review
Same signature as the LTC/BCH and ETH/BTC cointegrated-spread pairs and L55 (single-name/spread fade with PF<1.15 never clears costs). QA's fee-fragility concern is borne out and worse on full history.
Analysis
Backtest gate:
- metrics unreliable: Incoherent: Sharpe 0.02 disagrees in sign with total_return -19.77% — 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
DotKsmCointegratedSpreadMeanReversio-74ef511725
Outcome Summary
This strategy proposed a differentiated, untried idea: a market-neutral DOT/KSM cointegration mean-reversion pairs trade with a frozen-at-entry hedge spread and a half-life stationarity gate, reaching iteration 2 after an earlier fix to a drifting-spread exit bug. The code was judged a fair and correct implementation of the cointegration mechanism, but on a decisive 6-year, 144-trade sample it returned -10.43% with a negative Sharpe and a profit_factor of 0.895 — gross-negative before costs. Because the residual lost across every volatility regime and most years, with its sole positive year carried by one outlier day, the analyst abandoned it at the backtest-review gate as a falsified premise, matching prior LTC/BCH and ETH/BTC cointegrated-spread failures. It never reached optimization, risk review, or paper trading.
Outcome Summary
A genuine structural tether between two assets does not guarantee a tradeably stationary spread — a profit_factor under 1 signals the edge is gross-negative before fees, so optimization cannot rescue it.
Outcome Summary
The analyst issued an 'abandon' verdict at the pre-optimization backtest-review gate: profit_factor below 1 means the signal was gross-negative before costs (commission was only 1.82% of gross), so this was falsified premise rather than fee-fragility, and no parameter tuning could lift an edge that is below zero.
Outcome Summary
A market-neutral statistical-arbitrage pairs trade betting that the cointegration residual of DOT vs its canary-network token KSM is stationary and mean-reverts, entering long/short the spread on z-score dislocations gated by an AR(1) half-life stationarity test.
Outcome Summary
Over a 6.05-year, 144-trade backtest it lost money: total_return -10.43%, Sharpe -0.082 (CI [-0.99, 0.63]), Sortino -0.11, profit_factor 0.895, expectancy -$72.68/trade, and avg_trade_return_pct of just 0.020% versus the 0.15% viability floor. It lost in all three volatility terciles and in most calendar years, with the only positive year (2024, +13.5%) driven almost entirely by a single outlier day.
Backtest and paper results are hypothetical. Trading involves risk of loss.