Skip to content
All strategies

Strategies

LTC/BCH Bybit perpetual log-ratio convergence, window-robust EWMA anchor, fee-floored entry, one-leg volume-shock veto (4H, dollar-neutral)

Outcome: Abandoned

LtcBchBybitLogRatioEwmaConvergence

Outcome Summary

This hypothesis applied three rules from a quant.stackexchange answer to an LTC/BCH Bybit perp convergence trade: an anchor that holds across window lengths, an absolute 6% fee floor for entry, and a volume-asymmetry breakdown veto. Over 3 iterations the developer reworked the per-bar volume and median logic for speed in iteration 2 and fixed a leverage-parameter config consistency issue in iteration 3. The strategy still timed out in the Layer 3 sandbox backtest (over 300s on ~20000 4H bars) and was abandoned in the verification loop. Backtesting, optimization, analyst review and risk review were never reached, so the trading thesis remains untested.

Hypothesis

Source: Sixk, 'Pair trading - history length for spread calculation', quant.stackexchange.com/questions/80948, plus the answer by 'THATS MY QUANT' (quant.stackexchange.com/a/80953). The question runs a cointegration z-score pair trade on crypto perps and finds the results swing with the lookback (200 vs 500 candles). The answer gives three rules: (1) do not choose the window by backtest or p-value; (2) measure whether the divergence is large enough to pay fees and slippage; (3) ask why the pair relationship……Show moreShow less

Source: Sixk, 'Pair trading - history length for spread calculation', quant.stackexchange.com/questions/80948, plus the answer by 'THATS MY QUANT' (quant.stackexchange.com/a/80953). The question runs a cointegration z-score pair trade on crypto perps and finds the results swing with the lookback (200 vs 500 candles). The answer gives three rules: (1) do not choose the window by backtest or p-value; (2) measure whether the divergence is large enough to pay fees and slippage; (3) ask why the pair relationship exists and when it breaks down, and stand aside then. This hypothesis puts all three into one design. PAIR AND REASON: LTCUSDT.BYBIT and BCHUSDT.BYBIT linear perps. Both are 2011-2017-vintage PoW payment forks of the Bitcoin codebase. They sit in the same exchange 'legacy PoW' bucket and have a largely overlapping holder and market-maker base, with no DeFi or L2 narrative to drive one apart from the other. The relative price is therefore driven mostly by shared old-coin beta plus temporary flow imbalances. This is not the same-asset cross-venue spread that just died (SOL Bybit/OKX, HYPE spot/perp). That spread is a market-maker speed contest, which the answer explicitly warns against. This is a cross-ASSET relative-value spread with dislocations of 6-10%, not a few bps. WINDOW ROBUSTNESS: the fair-value anchor is an EWMA of log(LTC/BCH) with a half-life tuned over a broad range (60-180 4H bars, 10-30 days). The pre-study shows the sign of the edge holds across that range. No cointegration p-value is used for selection. FEE FLOOR: entry needs an ABSOLUTE log deviation of at least 6%, not just a z-score, so every trade starts about 27x above the 0.22% two-leg round trip. BREAKDOWN VETO: if the 24h volume of one leg relative to its own 30-day median is more than 1.8x the other leg's, the divergence is treated as idiosyncratic news, which is the answer's SAP-earnings example. In that case no entry is taken. Venue Bybit was chosen because it is 2.0% of the corpus, against a quota of 5% or more. LTC and BCH are nearly unused in the corpus, and Bybit 1H bars run from Oct/Dec 2020, about 5.8 years. Bars are resampled to 4H in-strategy, or 4H bars are used directly.

The source is a concrete pair-trading mechanism on crypto perps, so it is classified (a). It is refined per the source's best answer: no selection of the window by p-value, an explicit fee floor, and a breakdown veto. Bybit is used because it sits under its venue quota (2.0% vs 5% or more). The design is long/short and dollar-neutral, filling the under-represented long_short bucket (15%). LTC and BCH are essentially unused in the corpus. It is not the same-asset cross-venue spread (SOL Bybit/OKX, DOGE Bybit/OKX, HYPE spot/perp) that keeps dying as a speed and fee contest. Predictions are modest because the pre-study t-stat is about 1-2.

verification_loop: sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of LTCUSDT.BYBIT-4-HOUR-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).

Implementation

Dollar-neutral pair trade on the LTC and BCH Bybit perps using 4H bars. It trades the gap between log(LTC/BCH) and its EWMA anchor (half-life 60-180 bars). It enters only when the absolute gap is at least 6%, a fixed fee floor, shorting the expensive leg and buying the cheap one. An optional veto skips the entry when only one leg has an unusual 24h volume spike. A trade exits when the gap closes back through exit_dev, widens against the position to stop_mult*entry_dev, or reaches the maximum holding time.

Iteration 3 fixes only the Layer-1.5 failure. The optimization_plan fixes `leverage` at 2.0 as a parameter, so the parameters now include leverage=2.0 as a float, matching the plan and config.leverage=2.0, and position_size reads it. Before submitting I checked the parameters with src.optimization.domains.validate_domains against the plan, and it passed. All other fixed values match the plan exactly, including their types: exit_dev 0.0, stop_mult 2.0, leg_fraction 0.25, cooldown_bars 6, volume_asym_ratio 1.8, volume_short_bars 6 and volume_median_bars 180. The starting values of the tunable parameters are within their allowed ranges: entry_dev 0.06, volume_veto 'on', max_hold_bars 42 and anchor_halflife_bars 120. Maximum gross notional is 2 legs x 0.25 x 2.0 = 1.0x equity. The signal, entry and exit logic is unchanged.

Verification Results

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of LTCUSDT.BYBIT-4-HOUR-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).

Iteration History

Verification failed (Layer 1.5 — hypothesis/config consistency) [class=hypothesis_mismatch]: - optimization_plan fixes leverage at 2.0

Outcome Summary

Two-leg strategies with rolling-median volume windows need to be profiled against the ~20k-bar sandbox budget before submission, because a performance-only rewrite (running sums and bisect-maintained sorted windows) still did not get it under the 300s limit.

It was abandoned in a verification loop. The Layer 3 sandbox smoke test went over the 300s wall-clock limit on a ~20000-bar window (2400 days of LTCUSDT.BYBIT 4-hour bars), so it never reached backtest review, analyst, or risk review.

A dollar-neutral 4H pair trade on LTCUSDT.BYBIT vs BCHUSDT.BYBIT perps that fades deviations of log(LTC/BCH) from an EWMA anchor, entering only when the absolute deviation is at least 6% (a fee floor) and standing aside when one leg's 24h volume shock exceeds the other's by more than 1.8x (an idiosyncratic-news veto).

There are no performance numbers: the backtest report is empty and optimization never ran, so no return, Sharpe or trade count exists.

Analysis

Pair trading - history length for spread calculation

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