Skip to content
All strategies

Strategies

Jesse MAGen Fixed-Default Linear-Regression Cross with ADX, LINK Hyperliquid 4H

Outcome: Abandoned

JesseMAGenLinkHyperliquid

Outcome Summary

JesseMAGenLinkHyperliquid reproduced the Jesse MAGen linear-regression cross with ADX and fixed ATR brackets on LINK Hyperliquid 4H bars, keeping all source defaults unchanged. After two iterations, the full 777-day backtest was mechanically clean (no missing bars, accounting reconciled, funding included) but lost 60.4% over 166 trades, with Sharpe -0.57 and a 70.5% drawdown. The loss came from a negative gross edge rather than fees, and the signal showed no information (IC -0.012), so the analyst abandoned it at backtest review. Optimization, risk review and promotion were never reached.

Hypothesis

Faithful fixed-default reproduction of MAGen by the Jesse community, supplied under the MIT licence at https://github.com/jesse-ai/example-strategies/blob/7c91e0a37bf62165790120d730442e4f6eb00364/MAGen/__init__.py. Trade LINKUSD.HYPERLIQUID using LINKUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL bars, one position at a time, both long and short. Instrument and interval are platform research choices; the supplied source specifies neither. Preserve all twelve source defaults, its balance-relative sizing, fixed entry-time ATR brackets, strict comparisons and unconditional pending-entry cancellation. This is a reproduction experiment, not a claim of demonstrated profitability. No additional trend, volume, funding, cooldown or time-exit filters are permitted.

The explicit request for faithful reproduction takes precedence over inventing a different mechanism. Hyperliquid is underrepresented at 9.4% against its 20% target, and long/short strategies address the portfolio's 81.6% long-only concentration. Four-hour bars avoid Hyperliquid's short-history sub-hourly limitation. LINK avoids adding another BTC or ETH experiment, although the supplied corpus_concentration is empty and LINK's exact prior share cannot be established. Single-instrument scope remains overrepresented, but adding a hedge would change MAGen. This generic crossover mechanism deserves low research priority; source fidelity, rather than presumed novelty, justifies the experiment.

Negative expectancy. The fixed-default Jesse MAGen reproduction (5/20 linear-regression endpoint cross, ADX 8 > 13 entry, fixed 2/5 ATR bracket, 3% risk) loses money on LINKUSD.HYPERLIQUID 4H over a reliable 166-trade, 777-day sample. Average trade return is -0.766% against the +0.15% Hyperliquid floor. PF is 0.746, Sharpe -0.57, max drawdown 70.5% (limit 25%), and both 2024 and 2025 lost money. The edge is negative even before costs: adding back commission and impact still leaves about -$36k. Signal IC is -0.012 (t=-0.18). The frozen plan has no tunable parameters, so optimization cannot change the result. This confirms QA's edge concern: the full history reproduces the smoke test (PF 0.755, -0.72%/trade), and funding is now folded in. Later stages should record this as fee_edge/no_edge on the first measured report. The verdict covers only this LINK HL 4H instrument and interval choice for the MAGen defaults, not the source's unspecified market.

Implementation

Fixed-default MAGen translation trading LINK Hyperliquid four-hour bars in both directions. Linear-regression endpoint crossovers enter when ADX is strictly above 13. Opposing MA ordering exits when ADX is strictly below 15. Entry-time ATR sets fixed venue-managed stop and target brackets at 2 ATR and 5 ATR. Sizing risks 3% of equity, capped at 1x equity notional.

Addresses the reported Layer 1.5 mismatch by explicitly setting leverage to 1.0 in both config.leverage and config.parameters.leverage, matching the frozen research plan. All executable strategy logic from previous_code is preserved; only an iteration header comment changes the source hash. The twelve source defaults, crossover comparisons, ADX exits, balance-relative sizing and pending-entry cancellation remain intact. FactoryStrategy market-entry brackets provide the platform order adaptation. Verification remains the pipeline's responsibility. The required outbox file could not be written because this session has read-only filesystem access; the complete task-bound JSON is returned directly.

Verification Results

Optional: in live mode, recompute from self._bars (bounded at 500) when a gap in bar timestamps is detected.

Indicator state (Wilder ATR/ADX, previous regression spread) only advances when calculate_signal runs. In a live/paper node, a primary bar dropped by the base staleness gate (clock - pts > staleness, not _in_warmup) skips _advance(), so the ATR/ADX recursions and the cross detection lose one bar. Backtests are unaffected because the sim clock means the gate never fires.

Acceptable for source fidelity (Jesse's risk_to_qty caps at balance). Optionally cap at 0.99x equity to leave room for fees.

With max_notional_equity_ratio=1.0 and leverage=1.0, the capital cap can request notional equal to 100% of equity. Initial margin plus taker commission can then slightly exceed free margin and trigger a venue denial when the risk-based quantity is not binding (wide ATR). The sandbox traded 166 times at 73% average position size, so this is rare, but those entries would be silently skipped.

None required.

_submit_entry is overridden to route through _submit_entry_bracket with ATR-derived fractions instead of setting use_bracket_orders. This works because base _process_primary calls _submit_entry when use_bracket_orders is unset, and the bracket prices close*(1 -/+ atr*rate/close) equal close -/+ atr*rate exactly. The static base_shadow warning is a deliberate override, not a defect.

Smoke test over 777 days and 166 closed positions: avg_trade_return_pct -0.72%, PF 0.755, win rate 29.5%, max drawdown 68%, and every vol regime lost money (normal was roughly flat). Commission is only 3% of gross, so this is not a fee problem. The 5-period vs 20-period linear-regression endpoint cross whipsaws on LINK 4H: there were 16 consecutive losses, and the 2:5 ATR bracket needs a win rate above about 29% just to break even before costs. Each trade risks 3% of equity at 1x notional, so drawdowns compound quickly. The frozen plan has no tunable parameters, so the full-history backtest is the final measurement. If the full run looks like this, treat it as a falsified reproduction rather than retuning. Also: funding_events_available=0 and funding_folded=false in the sandbox for a Hyperliquid perp. Check that the full backtest folds funding for positions held about 4 days on average.

Backtest Review

Sharpe
-0.57
Total return
-60.41%
Max drawdown
70.49%
Trades
166
Win rate
29.5%
Profit factor
0.75

The run is mechanically sound. It covers 777 days with 166 closed trades (91 long, 75 short), as the both-direction hypothesis requires. Inputs are clean: 0 missing bars and no duplicates. Accounting reconciles.

Funding is now folded in (funding_folded=true, 15555 events). The sandbox gap QA flagged is closed in this full run.

Average trade return is -0.766% against the Hyperliquid floor of +0.15%, about 0.92 percentage points below it.

Profit factor 0.746, Sharpe -0.57 (95% CI -1.95 to 0.75), total return -60.4%, CAGR -35.4%, max drawdown 70.5% against the pre-registered 25% limit.

Costs are not the cause. Commission ($5.4k) plus modeled impact ($19.1k) add back to only about -$36k of the -$60.4k net loss, so the gross edge is still negative. Commission is just 3.0% of gross.

Win rate is 29.5%, roughly break-even for a 2:5 ATR bracket before costs, and there were 16 consecutive losses. 2024 lost 50.3% and 2025 lost 36.3%. The calm regime (Sharpe -0.70) and stressed regime (-0.81) both lost; normal was about flat (-2.4%).

The executed signal's IC is -0.012 (t=-0.18), which is no information. Gross edge is -0.04% per 20 bars.

Beta is 0.098, so this is not a beta story; the losses come from whipsaw in the linear-regression cross.

Iteration History

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

Outcome Summary

The fixed MAGen defaults whipsaw on LINK Hyperliquid 4H and lose money even before costs, so this instrument and interval choice should not be revisited without a materially different signal; the verdict does not cover other markets.

The analyst abandoned it at backtest review, before optimization, for negative expectancy: the gross edge was negative even before costs (about -$36k after adding back commission and impact), signal IC was -0.012 (t=-0.18), and drawdown far exceeded the pre-registered 25% limit. The frozen plan had no tunable parameters, so optimization could not change the result.

A faithful fixed-default reproduction of the Jesse community's MAGen strategy, trading long and short on LINKUSD.HYPERLIQUID 4H bars: a 5/20 linear-regression crossover gated by ADX(8) above 13, with fixed 2/5 ATR stop/target brackets and 3% balance-relative risk, as a reproduction experiment rather than a profitability claim.

Over 777 days and 166 closed trades (91 long, 75 short), it returned -60.4% (CAGR -35.4%) with Sharpe -0.57 (95% CI -1.95 to 0.75), profit factor 0.746, a 29.5% win rate and a 70.5% max drawdown. Average trade return was -0.766% of notional against the +0.15% Hyperliquid floor.

Analysis

MAGen

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