Skip to content
All strategies

Strategies

Crypto-Equity Residual Shock Reversal: fade a >=2-sigma 5-session BTC-beta-adjusted move in COIN/HOOD, hedged with a Bybit BTC perp (USEQ 1-DAY + BYBIT 1-HOUR, long-short, cross-venue)

Outcome: Abandoned

CryptoEquityResidualShockReversal

Outcome Summary

CryptoEquityResidualShockReversal paired COIN and HOOD daily bars with an hourly Bybit BTC perp hedge. It planned to fade 2-sigma residual shocks, using a rolling OLS beta and bisect-based BTC price lookup. Over 3 iterations the code was reworked, including a change to bounded extra-bar deques in iteration 3 to address an earlier timeout, but it never passed verification. The final Layer 3 sandbox backtest failed because a COIN.USEQ position executed after the evaluation boundary, with 0 primary bars reported as processed, so the run was abandoned before backtest review, optimization, or analysis.

Hypothesis

Cross-venue, long-short, beta-hedged relative-value strategy. It pairs two US-listed crypto-exposed stocks (COIN.USEQ and HOOD.USEQ on 1-DAY bars from the Yahoo UsEquitiesCollector; COIN daily data starts 2021-04-14, HOOD starts 2021-07) with the Bybit BTC linear perpetual (BTCUSDT.BYBIT on 1-HOUR bars from the Bybit collector, starting 2020-03-25). Both legs were checked and are present in the catalog. At each session close, for each stock, compute its daily log return r_s and the BTC log return r_b over the……Show moreShow less

Cross-venue, long-short, beta-hedged relative-value strategy. It pairs two US-listed crypto-exposed stocks (COIN.USEQ and HOOD.USEQ on 1-DAY bars from the Yahoo UsEquitiesCollector; COIN daily data starts 2021-04-14, HOOD starts 2021-07) with the Bybit BTC linear perpetual (BTCUSDT.BYBIT on 1-HOUR bars from the Bybit collector, starting 2020-03-25). Both legs were checked and are present in the catalog. At each session close, for each stock, compute its daily log return r_s and the BTC log return r_b over the SAME window. The BTC price comes from the latest BTCUSDT.BYBIT 1-HOUR bar whose close timestamp is at or before the equity bar's close (20:00 or 21:00 UTC). Find that bar with bisect on a sorted timestamp array built once, so each bar costs O(log n); never rescan history. Fit a rolling OLS beta of r_s on r_b over beta_lookback=60 sessions. The daily residual is e = r_s - beta*r_b. R5 is the 5-session sum of residuals, and z = R5 / stdev of 5-session residual sums over resid_vol_lookback=120 sessions. When |z| >= z_entry, fade the stock-specific move. If z >= +z_entry, short the stock and buy a beta-scaled BTC perp. If z <= -z_entry, buy the stock and short the beta-scaled BTC perp. The premise is short-horizon residual reversal (Lehmann 1990; Jegadeesh 1990), applied to a factor that equity residual models usually miss. Crypto-equity names trade on retail and ETF flows that overshoot the 24/7 crypto price that drives their fundamentals. BTC is the only correct hedge factor because it is the mechanism, which is why a BTC instrument is used despite BTC's corpus share. The BTC leg goes on BYBIT (2.3% of the corpus), not BINANCE (62%). This differs from the in-pipeline CoinOvernightBtcUnderreactionIntradayLS, which trades intraday catch-up toward BTC within one session on 1h bars; this strategy trades multi-session reversal of the residual, hedged, on daily bars. It also differs from the failed stock-vs-sector-ETF reversal, which died on a config/leverage mismatch rather than on economics, and used a different factor and universe. Sizing: the stock leg is stock_notional_pct (15%) of equity. The BTC leg's notional is beta times the stock notional, capped at 2x the stock notional. At most one open pair per stock, so at most 2 concurrent pairs and gross exposure of about 75% of equity or less; no leverage is needed. Leave config.leverage at its default and do not add a leverage parameter. Fee arithmetic: COIN's 5-session residual sigma is about 6-7% (stock-specific daily vol about 3%), so a 2-sigma trigger is a residual dislocation of about 13%. If about 25% of it reverts during the hold, the stock leg captures about 3.0% and the hedged pair returns about 1.2-1.5% on total two-leg notional. Round-trip cost is about 0.05% on the USEQ leg (spread plus impact) and about 0.11% on the Bybit leg (taker), roughly 0.10% blended on gross notional, so expected capture is more than 10x cost. Firing rate: a two-sided 2-sigma trigger on two names with holds of up to 10 sessions gives about 10-14 entries per name per year, about 100-130 pair trades over about 5.3 years. The trigger is a market observation, never a calendar date.

Fills the two buckets furthest from target: cross-venue (7.3% vs a >=15% target) and long-short (long-only is at 83.6% vs a <=55% target). It also puts the hedge leg on BYBIT (2.3% vs a >=5% target) instead of the overloaded BINANCE venue. BTC is used only because it is the economic factor being hedged out. It avoids the fee graveyard (multi-session holds, about 10x cost coverage), single perps gated on supplementary data (L111), options (L102), calendar windows (L179; the trigger is a residual z-score), and same-coin cross-venue dislocation (DOGE Bybit-OKX died as fee_edge). Leverage is deliberately NOT in optimization_plan.fixed, because that caused three recent Layer 1.5 failures. Every fixed entry is a strategy parameter with exactly the type shown.

verification_loop: Verification failed (Layer 3 — sandbox backtest): Position 87 (COIN.USEQ): execution time is after the evaluation boundary Bar type used: COIN.USEQ-1-DAY-LAST-EXTERNAL, Bars processed: 0 Ensure your strategy produces trades with the given data and parameters.

Implementation

Fades five-session BTC-beta-adjusted residual shocks in COIN and HOOD, with beta-scaled Bybit BTC hedges aggregated into one net position. Uses session-count holding limits, residual reversion and extension exits, and a pair loss stop.

Starts from previous_code and changes only extra-leg buffering to bounded deques, removing the base template's repeated 500-element list copies during hourly BTC intake. Existing rolling statistics, bisect point-in-time lookup, entry rules, sizing, instruments, parameter permissions and end-boundary guard are preserved. This is a runtime improvement, not a confirmed timeout fix: the previous code already bounded history, so another timeout should trigger engineering profiling of loading, engine execution and reporting rather than an alpha change. Verification was left to the pipeline as instructed. The requested outbox file could not be written because this workspace permits read-only filesystem access; the complete bound JSON is returned here.

Verification Results

Verification failed (Layer 3 — sandbox backtest): Position 87 (COIN.USEQ): execution time is after the evaluation boundary Bar type used: COIN.USEQ-1-DAY-LAST-EXTERNAL, Bars processed: 0 Ensure your strategy produces trades with the given data and parameters.

Iteration History

Verification failed (Layer 3 — sandbox backtest): Position 86 (BTCUSDT.BYBIT): execution time is after the evaluation boundary Bar type used: COIN.USEQ-1-DAY-LAST-EXTERNAL, Bars processed: 0 Ensure your strategy produces trades with the given data and parameters.

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of COIN.USEQ-1-DAY-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Outcome Summary

Cross-venue strategies that mix session-market daily bars with 24/7 hourly bars need order timing that respects the evaluation boundary, and the harness must be shown to process primary bars, before any edge can be measured.

After 3 iterations it was abandoned in a verification loop when the Layer 3 sandbox backtest failed: Position 87 (COIN.USEQ) had an execution time after the evaluation boundary, and the diagnostic reported 0 bars processed on COIN.USEQ-1-DAY-LAST-EXTERNAL.

Fade a >=2-sigma 5-session BTC-beta-adjusted residual move in COIN/HOOD (USEQ daily bars), hedged with a beta-scaled Bybit BTC perp, betting on short-horizon residual reversal of crypto-equity overshoots.

No performance was measured: the backtest report is empty and no optimization ran, so there are no return, Sharpe, or trade-count figures.

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