Skip to content

View original

HyperliquidDonchianBreakoutTrendLSBasketDaily

Hypotheses

Hyperliquid Channel-Breakout Trend-Following Long-Short Basket (Donchian, Risk-Parity, ATR-Trailed, Daily, Pure OHLCV)

Hypotheses

A long-short, multi-instrument TREND-FOLLOWING basket across ~12 of the most liquid Hyperliquid perpetuals, using a CHANNEL-BREAKOUT (Donchian) signal rather than moving-average momentum or cross-sectional ranking. Each asset independently goes LONG when it breaks out above its N-day high and SHORT when it breaks below its N-day low — the classic turtle/managed-futures breakout primitive. This stays strictly inside the one validated envelope in this factory (the promoted long-short trend basket: OHLCV-only, multi-asset, market-neutral-ish, Sharpe 1.48) while being genuinely differentiated: breakout is a distinct trend signal from MA-momentum, it is per-asset absolute (not a cross-sectional rank), and it runs as a diversified BASKET (unlike the existing single-asset SOL Hyperliquid Donchian). Crucially it is OHLCV-ONLY, so it is DATA-SAFE — it avoids the per-asset-supplementary-data block (funding loads for the primary symbol only) that structurally killed the funding-carry basket, and it avoids every other refuted class this session (no funding, no spot-perp/cross-venue basis, no cross-asset ratio MR, no options). Both legs and all assets trade same-venue on Hyperliquid at the same daily bar timestamps, so there is no cross-exchange fill-timing or neutrality-leak artifact. Few parameters (channel length, trail multiple) to resist the overfitting that has been the recurring failure mode. Fills the under-represented Hyperliquid venue, long-short direction, and multi-instrument scope buckets.

Hypotheses

Iteration 2 fix for the Layer-2 synthetic failure (`TypeError: super(type, obj): obj must be an instance or subtype of type`). The Layer-2 proxy binds overridden methods to a plain `_Wrapper` that is NOT an instance of the strategy class, so the zero-arg `super().on_extra_bar(bar)` raised TypeError on the very first extra bar. The base `on_extra_bar` is a documented no-op and the proxy (like the real engine's `on_bar`) already buffers the extra bar into `self._extra_bars` before invoking the override, so the `super()` call contributed nothing. The single, minimal change is removing that `super().on_extra_bar(bar)` line; the breakout signal, risk-parity sizing, ATR trailing exit, gross-cap, and timestamp-guarded basket sweep are all unchanged, preserving the already-passing Layer-1 (static) checks.

Hypotheses

Directional HL trend basket in the survivor envelope but well short of it, with the holdout window falling in a deep loss — not worth 2 hours of optimization. Over 811 measured trades: Sharpe 0.55 with bootstrap CI [-0.285, 1.356] straddling zero, PSR 0.91 (<0.95), profit_factor 1.21 — less than half the promoted survivor's Sharpe 1.48. The +192% total is bull-carried (2021 +74.5%, 2024 +48.7% dominate, with a +26% single day on 2024-01-03) while 2025 is -25.98% and 2026 +1.9%, so the last-20% holdout (≈ mid-2025 → 2026) sits squarely in a negative/flat stretch (rolling Sharpe to -8) and would very likely fail the unwaivable holdout hard gate. max_drawdown is 34% with CI to 70% — above the promotion floor with a catastrophic upper bound. It is also on Hyperliquid, a zero-survivor venue this factory (L82, HL 0/128), whereas the surviving trend-basket envelope was on Binance. avg_trade_return_pct 2.73% clears fees and there is no liquidation, so it isn't fee-dead or blown up, but the ~225-trial deflated Sharpe plus the dead holdout window make the ANALYZING outcome a predictable rejection. Failure pattern: no_edge/overfit HL directional trend basket, not significant, holdout regime dead (L82/L19).

Implementation

Long-short Donchian channel-breakout trend-following basket across 12 of the most liquid Hyperliquid perpetuals on daily bars, pure OHLCV. Each asset independently goes long on a break above its prior N-day high and short on a break below its prior N-day low, rides the move with an ATR trailing stop, and exits on an opposite-channel break. Risk-parity (equal distance-to-stop risk) sizing per book, with a per-position notional cap and a 1.0x portfolio gross cap (no leverage). Same-venue, same-timestamp daily fills avoid cross-exchange timing artifacts.

Verification Results

CLEAN RESTART 2026-09-04 — this run's verdict history and learning records were removed and it was restarted from verification. Its previous abandonment came from the pipeline, not from the market: the Layer-2 harness mis-bound @staticmethod helpers (fixed), QA issued terminal performance verdicts on an unoptimized smoke test (removed — QA now judges correctness only), and sandbox timeouts came from backtest-slot starvation (fixed). The hypothesis and the strategy code are unchanged. Verify the code on its merits; performance is decided later by the full backtest and the optimizer.

Verification Results

Accumulate same-sweep pending notional and add it to _current_gross within the loop so the Nth breakout on a broad-trend day sees entries 1..N-1 committed and the 1.0x cap holds intra-bar.

Verification Results

Gross-exposure cap under-enforcement. On daily bars all 12 assets share the same timestamp, so _manage_all processes them in one sweep and _current_gross reads cache.positions_open, which does NOT include entries submitted earlier in the SAME sweep (they fill next bar). On a broad breakout day, each flat asset sees only prior-day gross and passes the 1.0x cap independently, so combined new entries can push entry gross above gross_cap_frac*equity. The engine's leverage=1.0 margin model backstops actual fills, but the in-strategy 'no leverage' cap the hypothesis names is not reliably enforced by the strategy itself. Not a look-ahead or crash bug, and MTM growth from winners is separate/expected.

Verification Results

Analyst/data-engineer to confirm validity of pre-2023 HYPERLIQUID daily bars before trusting the full-history backtest; if synthetic/unavailable, restrict the evaluation window to the covered period.

Verification Results

Hyperliquid data provenance for early years. The basket includes alts (ARB, OP, ATOM) and the backtest spans ~2207 data_days (~6y) with trades in 2021-2022 stress windows, but HL's perp venue launched in 2023. The per-asset min_bars_required guard means an asset only trades once it has data (code is safe), but the pre-2023 BTC/ETH HL history driving much of the +201% may be backfilled/proxied — outside the strategy's control.

Backtest Review

Sits in the one validated envelope (OHLCV long-short trend basket); well-measured (811 trades over 6 years), directional not market-neutral

Backtest Review

avg_trade_return_pct 2.73% clears fees comfortably (commission 1.37% of gross); no liquidation; clean risk-parity multi-asset construction

Backtest Review

Positive in most years and diversified across 12 HL perps

Backtest Review

Not significant: Sharpe 0.55 with CI [-0.285, 1.356] straddling zero, PSR 0.91 (<0.95), PF 1.21 — less than half the survivor's Sharpe 1.48

Backtest Review

2025 is -25.98% and 2026 +1.9%; the last-20% holdout window sits in this dead/negative stretch (rolling Sharpe to -8) — high holdout-gate failure risk

Backtest Review

max_drawdown 34% with CI to 70% — above the promotion floor; result is outlier/bull-carried (2021 +74%, 2024 +49% dominate; 2024-01-03 +26% single day)

Backtest Review

Hyperliquid is a zero-survivor venue (L82, HL 0/128); the surviving trend-basket envelope was on Binance, not HL

Iteration History

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['assets', 'risk_frac', 'atr_period', 'trail_mult', 'min_notional', 'qty_precision', 'channel_length', 'gross_cap_frac', 'exit_channel_frac', 'max_position_frac', 'default_qty_precision'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: super(type, obj): obj must be an instance or subtype of type (bar timestamp: 1735689600000) - steady_downtrend: TypeError: super(type, obj): obj must be an instance or subtype of type (bar timestamp: 1735689600000) - flat_ranging: TypeError: super(type, obj): obj must be an instance or subtype of type (bar timestamp: 1735689600000) - volatility_spike: TypeError: super(type, obj): obj must be an instance or subtype of type (bar timestamp: 1735689600000) - zero_volume: TypeError: super(type, obj): obj must be an instance or subtype of type (bar timestamp: 1735689600000) - price_gap: TypeError: super(type, obj): obj must be an instance or subtype of type (bar timestamp: 1735689600000)

Iteration History

data_unavailable: backtest data for BTCUSD.HYPERLIQUID could not be collected after 5 retries: - bars (bar_type=ARBUSD.HYPERLIQUID-1-DAY-LAST-EXTERNAL): got 0, needed 50, or 90+ days span The data layer (not the strategy) is the blocker — re-evaluate this hypothesis once collection is fixed / the symbol is backfilled.
Strategy report

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