Skip to content

View original

BtcHyperliquidOneHourImpulseBarContinuationLS

Hypotheses

Hyperliquid BTC Intraday Impulse-Bar Continuation, Long-Short (1H, High-Volume Thrust Entry, Fee-Clearing ATR Targets, Discrete Single-Position)

Hypotheses

A single-instrument, long-SHORT intraday CONTINUATION strategy on BTCUSD.HYPERLIQUID using 1-HOUR bars, extending the factory's EXPLICITLY-SANCTIONED, generalizing intraday impulse-continuation family (the analyst twice redirected novelty here, away from the now-exhausted momentum-basket refinements and dead single-asset TSM). It detects an IMPULSE BAR — an abnormally large, high-volume directional thrust — and enters in the thrust direction to capture the short-horizon autocorrelation/continuation that follows an information/flow event. This is the validated CONTINUATION direction (crypto continues after thrusts), NOT the dead fade/reversion family, NOT the decayed slow VWAP-anchored continuation, NOT a momentum-basket refinement (all four basket overlays degraded the promoted basket — STOP), and NOT single-asset TSM (dead). It is mechanically distinct from everything in the portfolio on BTC HL (HL BTC momentum is daily; this is an intraday impulse event). It fills the under-represented HYPERLIQUID venue (7.7% vs >=20%) and the shorter-horizon buckets, and crucially it SIDESTEPS the HL data wall: HL's ~3yr history is too thin for daily walk-forward (few bars/trades) but provides ~26k 1H bars — ample for intraday validation. Engine-safe by construction: discrete enter-once/exit-once, single position, hard-capped notional, NO continuous rebalancing and NO vol-scaling/netting-flips (the constructions that triggered the recurring notional-inflation artifact). Geometry is deliberately wide-target/tight-stop (TP >= SL) to avoid the flush-bounce failure (1:3.3 reward:risk that needed a 77% win rate). Core parameters kept minimal (impulse threshold, TP, SL).

Hypotheses

Iteration 3 change (clean restart; the mechanism and signal logic from previous_code are untouched): the only defect left in the prior code was that the ATR take-profit and stop were evaluated on 1H bar CLOSES, so a bar that pierced the stop intra-bar and closed back inside never exited and every exit slipped by up to a full hour of range. The ATR distances are now converted to fractions of the entry price in should_enter (_arm_bracket) and handed to the base template bracket path via stop_loss_pct/take_profit_pct, so both legs rest at the venue and trigger intra-bar; should_exit keeps ONLY the max-hold time stop when brackets are on (no duplicated levels, no double-exit) and retains the old bar-close price exits as the fallback if use_bracket_orders is turned off. Bracket distances are clamped to a [min_stop_frac, max_stop_frac] band so a degenerate ATR cannot place a 0-width or absurd leg. Geometry stays wide-target/tight-stop: the declared _param_bounds keep tp_atr_mult >= 1.5 and sl_atr_mult <= 1.5 so TP >= SL for every value the optimizer can search, making the relational clamp unreachable. Entry frequency is unchanged (a single two-condition gate that fires on ordinary weeks of 1H BTC data), sizing is capital-relative and single-position, imports and structure are identical to the previously passing code.

Hypotheses

negative_expectancy: on an adequate 439-trade sample the strategy is net-losing (total_return -6.94%, profit_factor 0.874, Sharpe -0.94) and avg_trade_return_pct 0.038% sits well below the ~0.15% Hyperliquid taker fee floor. Negative across all three vol regimes, so this is a genuine absence of continuation edge after costs, not a tunable cliff. Optimization cannot raise a per-trade edge that is below round-trip cost and a PF below 1.0. QA's edge_concern is confirmed on the full-history run.

Implementation

BTCUSD.HYPERLIQUID 1H long-short impulse-bar continuation. An impulse bar is a bar whose directional body exceeds impulse_atr_mult*ATR(14) AND whose volume exceeds vol_mult times the trailing 20-bar mean volume; the strategy enters in the thrust direction (BUY bullish, SELL bearish) with one position at a time and 20% of equity notional at leverage 1.0. Exits are an ATR take-profit (tp_atr_mult*ATR) and ATR stop (sl_atr_mult*ATR) placed as a venue-managed bracket at entry so they fire intra-bar, plus a max-hold time stop of 24 bars owned by should_exit(). calculate_signal returns the continuous signed body-in-ATR every bar.

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

If the base uses its own min_bars_required for warm-up gating, ensure the override's larger value (atr_period/vol_lookback+2) is respected; otherwise rename to a private helper to avoid shadowing.

Verification Results

min_bars_required() overrides a base-template method (flagged by static analysis). The override is deliberate and internally consistent (used as the warm-up gate in calculate_signal), so it is functionally correct, but confirm the base template does not rely on its own implementation for the primary warm-up dispatch.

Verification Results

Sandbox (unoptimized default draw) is net negative: total_return -6.9%, PF 0.87, win_rate 0.38, avg_trade_return_pct 0.038% (well below the 0.15% futures floor). This is NOT a polarity/sizing bug (no 0% win-rate, |Sharpe|<1, PF!=0, longs 0.397 vs shorts 0.364 both plausible) but a thin-edge signature: the wide-target/tight-stop geometry only wins 38% of the time and default ATR mults produce per-trade returns that barely clear HL round-trip cost. The structural TP min (~0.30% at the 0.0015 stop-frac floor, 2x SL geometry) DOES clear the ~0.09% HL taker round-trip, so a viable region may exist, but the analyst should verify per-trade edge on the full-history optimized run before trusting the mechanism — continuation-after-impulse at 1H may not clear costs after fees.

Backtest Review

Faithfully implements the stated hypothesis: discrete single-position impulse-bar continuation, balanced longs (214) vs shorts (225), no notional-inflation artifact, engine-safe bracket geometry.

Backtest Review

Adequate sample for judgement: 439 trades over 328 days of 1H bars — this is measurable, not a low-trade-count trap.

Backtest Review

Drawdown modest (10.7%) and no polarity bug (long win 0.397, short win 0.364 both plausible).

Backtest Review

Negative expectancy on a reliable sample: total_return -6.94%, profit_factor 0.874, Sharpe -0.94, win_rate 0.38, expectancy -15.7 USD/trade.

Backtest Review

avg_trade_return_pct 0.038% is far below the ~0.15% Hyperliquid round-trip fee floor — the per-trade continuation edge does not clear costs, and commissions+impact consumed ~15% of gross plus more.

Backtest Review

Regime attribution is negative across all three vol terciles (calm -0.59, normal -1.57, stressed -0.18 Sharpe) — the loss is not a single-regime accident, the mechanism has no edge.

Backtest Review

QA's edge_concern is borne out on the full-history run: 1H impulse-continuation does not clear fees after costs. Optimization tuning three ATR/threshold params cannot convert a below-fee, sub-1.0-PF signal into a viable one.

Analysis

Backtest gate: - metrics unreliable: 308 trades / 328 data days is too little evidence (need >=5 trades over >=10 days) — increase signal frequency or widen the window

Iteration History

data_unavailable: backtest data for BTCUSD.HYPERLIQUID could not be collected after 5 retries: - bars (bar_type=BTCUSD.HYPERLIQUID-1-HOUR-LAST-EXTERNAL): got 0, needed 200, or 30+ 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.