Skip to content

View original

LinkHyperliquidVolTargetedTimeSeriesMomentumLS

Hypotheses

LINK Hyperliquid Volatility-Targeted Time-Series Momentum, Long-Short (Single-Instrument LINKUSD.HYPERLIQUID Perp, 4H Bars, Classic Sign-of-Trailing-Return TSMOM with MA Confirmation, DYNAMIC Volatility-Targeted Position Sizing — Bigger in Calm Trends / Smaller in Chaos, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument, pure-OHLCV strategy on LINKUSD.HYPERLIQUID that implements the single most-replicated anomaly in the academic literature — TIME-SERIES (absolute) MOMENTUM (Moskowitz-Ooi-Pedersen) — with the standard robustness overlay that makes it survive out-of-sample: DYNAMIC VOLATILITY TARGETING of position size. This is deliberately differentiated from the five momentum strategies already in this factory's pipeline (SOL Donchian breakout, ETH RSI pullback, AVAX efficiency-ratio gate, BTC dual-TF confluence, SOL BTC-regime gate) in TWO ways they all share and this one changes: (a) the signal is the plainest possible robust momentum — the SIGN of the trailing K-bar return, confirmed by price vs a moving average — rather than a bespoke breakout/pullback/gate construction that invites overfitting (overfit is this factory's #1 killer at 249x); and (b) position size is not a fixed 1.5% ATR-risk but a VOLATILITY-TARGET: notional is scaled inversely to recent realized volatility so the strategy takes larger exposure in calm, clean trends and automatically de-risks in chaotic high-vol regimes — the mechanism that historically stabilizes momentum's OOS Sharpe and tames drawdowns. Fills the most under-represented data-safe buckets: HYPERLIQUID venue (6.0% vs 20% quota) and long_short direction (13.7% vs target), on a fresh asset (LINK) not yet used on HL. Uses HYPERLIQUID 4H bars (~2.3 years usable history, above the sub-hourly wall), single instrument (no cross-venue schema-merge landmine, no spot-lookup timing bug), pure OHLCV, no supplementary feed (best-surviving tag family at 4%). Avoids every recent death mode: no options-expiry cadence, no funding fee-floor, no 90-day liquidation-feed wall, no COIN-M booking defect, and — by using the canonical robust signal rather than a fragile fitted one — directly targets the overfit failure that killed the LINK spot dip-buyer (PBO 0.89) and most bespoke signals.

Hypotheses

This is a one-line-class-of-change fix to a self-inflicted deadlock, not a re-tune. The Layer-3 diagnostic said should_enter() returned a side 0 times over ZERO evaluated bars across 2,199 processed bars — zero *evaluated* bars means the base class never called the signal path at all, so no threshold could have been at fault. I traced it to a hard interaction in base_template: line 288 trims self._bars to _max_bars = 500, and line 309 gates the whole signal path on len(self._bars) >= min_bars_required(). Iteration 2's canonical-horizon change made min_bars_required() return max(360, 540, 30) + 2 = 542, which the 500-cap buffer can never reach — so calculate_signal() was never invoked, the indicator deques never filled, and the run was structurally incapable of trading. Iteration 1 returned 52 from that method, which is precisely why it traded 117 times; the zero-trade regression was introduced by the horizon fix, not by the entry logic. The fix is to decouple warmup from the tunable windows: min_bars_required() now returns a small locked constant (32), because this strategy's indicators never read self._bars — they own their own deques (_closes, _ma_win, _rets), which are unaffected by the 500-bar cap — and the genuine warmup gate already lives in should_enter(), which refuses to trade until the momentum, MA and realized-vol buffers are each individually full. That also makes the strategy optimizer-safe: the walk-forward optimizer can now raise ma_window past 500 without silently re-deadlocking the run, which would otherwise have produced phantom zero-trade windows during optimization. Nothing else changed. The signal, entry/exit logic, hysteresis, disaster backstop, cooldown, vol-targeted sizing, imports and all risk constants are byte-identical to iteration 2, so the Layer-1 and Layer-2 passes are preserved and the previously measured behaviour stands: with the 540-bar MA warm after ~540 of the sandbox's 2,199 bars, my vectorized sim of this exact configuration produced 15 trades in the 365-day window (+7.3% return, 12.2% max drawdown, PF 2.12) and 50 trades over the full 2.5 years (+19.9%, 18.3% drawdown, PF 1.68), so Layer 3's >=1-trade requirement is comfortably met. The thin-sample caveat from iteration 2 still stands and should drive the analyst's decision: ~50 trades over 2.5 years is a wide confidence interval, and the horizon was selected after observing a grid, so this must be judged on holdout and OOS results rather than in-sample ratios.

Hypotheses

Statistically empty, outlier-carried single-perp momentum on a zero-survivor venue/mechanism class — not worth 2 hours of optimization. Only 46 trades over 2.6 years (below the ~100-trade measurability floor, L10), so the 3-window walk-forward and 20% holdout would each contain single-digit trades and any optimized Sharpe would be best-of-N noise. Sharpe 0.466 with bootstrap CI [-0.797, 1.649] straddles zero by a wide margin and PSR 0.76 (<0.95) — not distinguishable from no-skill even before the ~225-trial deflation. The 33.4% return is outlier-driven: 2025-01-31 alone (+22.9%) is ~two-thirds of it, with a +12.7% final bar and kurtosis 9.1 — strip a handful of days and the edge is gone. This is the Hyperliquid single-perp OHLCV momentum family (0/128, L82) on LINK, whose momentum-confluence already died 'no latent edge', and the developer honestly concedes the K=360/MA=540 horizon was selected as the only monotone-positive grid cell (selection bias baked in) and that it must not be promoted on in-sample ratios. Not fee-dead and DD contained, but no parameter tuning conjures significance from 46 outlier-driven trades in a zero-survivor class. Failure pattern: overfit/no_edge low-trade-count HL single-perp momentum, unmeasurable outlier-driven sample (L10/L82).

Implementation

Long-short time-series momentum on the LINKUSD Hyperliquid perpetual, 4H bars, at the canonical (months-long) TSMOM horizon. Direction is the sign of the trailing 360-bar (60-day) return, confirmed for entry by price versus a 540-bar (90-day) moving average: long when both are positive, short when both are negative, flat on disagreement. Exits use hysteresis — only the trailing-return sign needs to flip — plus a locked 25% adverse-move disaster backstop, with a 12-hour calendar-anchored cooldown after each exit. Position size is volatility-targeted: notional equals equity times (15% annual vol target / current annualized realized vol), clipped to between 5% and 35% of equity. Leverage 1.0. Exactly three tunable parameters (momentum_window, ma_window, vol_target_annual); warmup, vol window, annualization factor, notional cap/floor, disaster stop and cooldown are locked constants.

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

Low frequency at the canonical horizon: 46 trades / ~2.6y, Sharpe CI straddles zero. Inherent to months-long TSMOM, not a bug; per-trade edge (4.2%) clears fees, but in-sample metrics can't stand alone and the holdout will have few trades. Weight OOS/holdout heavily; require holdout >0 Sharpe with >=10 trades on its own. If the optimizer shortens the horizon for more trades, re-check net per-trade return stays positive (developer's grid shows short horizons flip negative).

Backtest Review

avg_trade_return_pct 4.14% is well above the ~0.15% Hyperliquid fee floor — not fee-fragile

Backtest Review

max_drawdown 17.6% and PF 1.77 are contained; disaster stop and vol-targeting kept the iteration-1 blowup from recurring

Backtest Review

Clean canonical construction (sign-of-trailing-return TSMOM), 3 parameters, no supplementary-feed or cross-venue landmines

Backtest Review

46 trades over 2.6 years — below the ~100-trade measurability floor (L10); walk-forward folds and the 20% holdout would each hold single-digit trades, so any optimized Sharpe is best-of-N noise

Backtest Review

Sharpe 0.466 with bootstrap CI [-0.797, 1.649] straddling zero widely and PSR 0.76 (<0.95) — not statistically distinguishable from no-skill before deflation

Backtest Review

Outlier-driven: 2025-01-31 (+22.9%) is ~2/3 of the 33.4% total, plus a +12.7% final bar; kurtosis 9.1 — the edge is a few days, not a distribution

Backtest Review

HL single-perp OHLCV momentum is a zero-survivor class (L82, hyperliquid 0/128) and LINK momentum already died 'no latent edge'; horizon was chosen after grid observation (developer admits the selection bias)

Iteration History

Verification failed (Layer 4 — QA review): - CATASTROPHIC DRAWDOWN / RISK BLOWUP past the >50% hard-abandon line. max_drawdown 63.4% (CI up to 99.86% — near-liquidation) with total_return -61.2% over 365 days. The hypothesis's central claim — that vol targeting TAMES momentum drawdowns — is refuted by its own backtest: with no stop-loss and inverse-vol sizing averaging 83.9% of equity notional, losing streaks in the 72% of trades that lose compound into a near-account-wipe. The vol estimate is backward-looking (de-risks only AFTER a spike) and the 0.40 target sizes far too aggressively for LINK. - MISLEADING RISK-ADJUSTED METRICS. Sharpe +1.48 / Sortino 2.53 / PSR 0.97 are internally CONTRADICTED by total_return -61.2%, PF 0.49, win_rate 0.28. The positive arithmetic Sharpe is an artifact of extreme positive skew (+1.59; one $14,690 win ~10x a normal position) while the GEOMETRIC outcome compounded to -61% via volatility drag from ~84% notional sizing. A promotion on these ratios would trust a strategy that lost 61% and nearly liquidated. Trust total_return / max_drawdown / PF instead. - NEGATIVE PER-TRADE EDGE. PF 0.49 (loses ~2:1), avg_trade_return_pct -0.636% (below fee floor), win_rate 0.28 over 117 trades — the sign-of-trailing-return TSMOM signal has negative expectancy on LINK/HL. Vol targeting only SCALES returns; it cannot flip a negative-edge signal positive. Lowering vol_target shrinks the loss/drawdown but still leaves a loser, so the drawdown fix and the edge problem are different levers. - The code is CORRECT and faithfully implements the hypothesis: causal trailing K-bar return signal, MA-confirmed long/short entry (signal>0 & close>MA -> BUY; mirror -> SELL; flat on disagreement), signal-flip exit (no stop, by design), inverse-vol sizing clipped [0.05,1.0], calendar-anchored cooldown, O(1) running-sum indicators, correct venue routing (HL futures, shorts). NO code bug — noted so the developer does not chase a phantom defect; the failure is risk/edge, not logic.

Iteration History

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: LINKUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL, Bars processed: 2199 Diagnostics: should_enter() returned a side 0 times over 0 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds. Ensure your strategy produces trades with the given data and parameters.

Iteration History

Verification failed (Layer 4 — QA review): - STRUCTURALLY UNMEASURABLE SAMPLE (L16). The canonical 60-day/90-day TSMOM horizon produces only 14 trades in the sandbox and ~50 over the full 2.5-year history — below the ~100-trade floor needed to distinguish edge from noise. Sandbox Sharpe 0.29 with CI [-1.25, +1.92] straddles zero. Unlike the short-horizon HL momentum siblings (57-77 sandbox / ~100-150 full trades) where the full backtest CAN settle the edge, this long-horizon system cannot reach a validatable sample at any point, and walk-forward would have ~17 trades/window — too few for a reliable IS/OOS ratio. The full backtest cannot resolve this; per L16 reject at Layer 4 rather than burning the 3-phase optimization. - THE POSITIVE RESULT IS REGIME-SPECIFIC, NOT A ROBUST EDGE. The +5.96% is driven almost entirely by shorts in a LINK down-year: short_win_rate 0.80 (8/10) vs long_win_rate 0.25 (1/4). Realized reward:risk is UNFAVORABLE (avg_win $1664 < avg_loss $1805), so PF 1.66 rests entirely on a 64% win rate over 14 trades — unlikely to persist and would reverse in a LINK up-regime where the short-dominated book loses. - OVERFIT-BY-GRID-SELECTION. The developer honestly discloses the shipped horizon (K=360/MA=540) is the ONLY strongly-positive point in a grid where every shorter horizon is negative/marginal, chosen after observing that grid. The TSMOM-months prior mitigates but does not eliminate the selection bias; overfit is the factory's #1 killer and the sibling LINK spot dip-buyer died at PBO 0.89. A ~50-trade sample chosen at the one working grid point is a classic overfit setup walk-forward cannot reliably clear. - CREDIT WHERE DUE — the iteration-3 fixes are correct and genuine. The zero-trade deadlock is properly fixed (min_bars_required now a locked constant 32, decoupled from tunable windows; indicators own deques independent of the base 500-bar cap; warmup enforced in should_enter). The iter-1 risk blowup is genuinely fixed: avg_position_pct 26.9% (was 83.9%), max_drawdown 10.0% (was 63.4%) via vol_target 0.15, cap 0.35, 25% disaster stop. Code is correct and faithful with NO L17 defect signature. The block is NOT code or risk.
Strategy report

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