Skip to content
All strategies

Strategies

Howtrader TurtleSignalStrategy by 用Python的交易员: faithful signal port on LTC Hyperliquid

Outcome: Abandoned

LtcHowtraderTurtleSignal

Outcome Summary

LtcHowtraderTurtleSignal ported the Howtrader TurtleSignalStrategy to LTC perpetuals on Hyperliquid at 4h, keeping the source defaults and changing only the bar timeframe and the position sizing. After 2 iterations, the backtest produced 236 trades over 799 days with a -36.2% return, Sharpe -1.59, profit factor 0.545 and a 36.5% drawdown, more than twice the pre-registered 15% limit. QA had pointed to execution costs, but the analyst found that the signal also loses before costs, and the signal direction was confirmed correct, so the loss is not a code defect. The analyst abandoned it at backtest review, and optimization, analysis and risk review were never reached.

Hypothesis

Translate the supplied tradeable CtaTemplate strategy, credited to 用Python的交易员, without correcting its unusual ladder or fill callbacks. Preserve source defaults exactly: entry_window=20, exit_window=10, atr_window=20, fixed_size=1. Use LTCUSD.HYPERLIQUID perpetuals, long and short, with LTCUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL bars. Four-hour input is an explicit platform adaptation: the original tick-fed BarGenerator normally builds minute bars, while Hyperliquid minute history is insufficient for substantial validation. Capital-relative sizing is the other explicit adaptation: fixed_size=1 represents one campaign-frozen risk unit rather than literally one LTC. No added indicator, regime filter, profit target, time stop or funding signal. Preserve initialization of all channel, entry, stop and ATR variables to zero; source initialization requests load_bar(20), meaning historical days rather than a 20-bar warm-up. Logging and put_event are lifecycle/display operations. Source on_order and on_stop_order callbacks contain no trading logic. Performance is unverified.

Hyperliquid is underrepresented at 8% against a 20% target, and long-short experiments are only 17.2%. Corpus concentration is empty, so LTC's actual recent share cannot be established. The explicit faithful-port request takes precedence over inventing a different mechanism for diversity. This mechanism overlaps the listed AvaxFrozenChannelTurtleSignal and EtcTurtleDonchianBreakoutLS experiments; a symbol change does not establish novelty. Check their full definitions before admitting this experiment, and defer it if it duplicates an existing faithful source port. Do not present it as a new alpha family.

Negative expectancy on a reliable sample. Per-trade return is -1.88% against the +0.15% Hyperliquid floor. PF is 0.545, Sharpe -1.59 with a 95% CI of [-3.03, -0.27], and PSR 0.022 on 236 trades over 799 days. Every year and every volatility regime lost money. Max drawdown of 36.5% is more than twice the pre-registered 15%. QA suspected execution cost was the cause. That is partly true, but costs are only part of the loss: with the $10.9k impact and $3.5k commission added back, gross PnL is still about -$21.8k, so the 20/10 Donchian turtle signal on 4h LTC Hyperliquid loses before costs. This is a faithful port with fixed source defaults and no tunable parameters (the optimization plan's tunable set is empty), so optimizing or iterating has nothing to change. Signal direction checks out, so this is not a code defect. The mechanism has also failed in earlier turtle ports on other symbols.

Implementation

Faithful port of the howtrader TurtleSignalStrategy on LTCUSD.HYPERLIQUID 4-hour bars. When there is no position, the strategy freezes a 20-bar Donchian entry channel and a 20-period Wilder ATR. It then places four-step long and short stop-order ladders at the venue, at the channel edge plus or minus 0, 0.5, 1.5 and 3.0 ATR. While a position is open, the remaining ladder steps stay in place for pyramiding. A reduce-only stop covers the full position: for a long at max(long_stop, 10-bar low), for a short at min(short_stop, 10-bar high). Fill callbacks follow the source's on_trade logic: a buy fill sets long_stop to the fill price minus 2 ATR, and a sell fill sets short_stop to the fill price plus 2 ATR.

Iteration 2 changes only what Layer 1.5 rejected. The optimization_plan fixes leverage at 1.0, so `leverage: 1.0` is now in parameters, matching config.leverage = 1.0. Sizing reads self.leverage from that parameter, which has no effect at 1.0. All other values the plan fixes are in parameters unchanged: entry_window 20, exit_window 10, atr_window 20, fixed_size 1, min_notional 10, unit_risk_fraction 0.0025 and unit_notional_fraction 0.075. The signal, ladder, stop and fill logic are identical to the previous iteration, so the expected trade count does not change. Two adaptations remain: 4-hour bars replace the source's tick-built minute bars, and fixed_size = 1 means one capital-relative risk unit, frozen for each campaign, rather than one LTC. This duplicates existing turtle ports on other symbols and is not a new alpha family.

Verification Results

Compute t = round(signed_quantity / unit, 6), or compare against k - 1e-9, so that exactly k units counts as k.

The pyramid count t = signed_quantity / float(size) is a float division. When the position equals exactly k units, floating-point error can give t slightly below k (for example 0.3/0.1 = 2.9999999999999996). The `t < k` branch then re-arms, and the position could grow past the source's 4-unit cap by one or two units. The source has the same float semantics, so this matches the source, but exposure can exceed the intended amount. The worst case remains bounded: about 6 units x 7.5% notional is roughly 45% of equity at 1x.

Leave the semantics as they are, but consider recomputing ATR only when flat (it already does) and skipping cancel/resubmit when the levels have not changed. That change is an engineering optimization, not a logic change.

The sandbox took 293 s of the 300 s budget for 4,787 bars, and runtime_review_required is set. Every bar cancels and re-submits up to 9 STOP_MARKET orders, and while flat it recomputes a 99-range ATR loop. Full-history optimization will be expensive.

No change required. Keep the override documented.

_process_primary and min_bars_required intentionally override the base methods. As a result, the base anti-stacking guard and the min-notional check are bypassed. Min notional is re-implemented per ladder level with min_notional=10, and the protective stop is reduce_only, so this is acceptable. Note that a reduce-only exit is not subject to the min-notional check, which is correct.

Sandbox: 236 closed positions, PF 0.57, win rate 18.6%, -33.9% return, DD 35% (the plan's max_drawdown_pct constraint is 15%). Modeled impact of $10.9k is about 3x commissions ($3.5k), so most of the loss is execution cost on stop-market fills, made worse by cancelling and re-placing 8 resting stops on every bar. I re-derived polarity line by line against the source: buy stops sit above the 20-bar high and sell stops below the 20-bar low, so the sign is not reversed. The low PF comes from the turtle payoff profile combined with impact, not from a wrong-way signal. Hyperliquid funding is not folded into PnL (funding_events_available=0), so multi-day holds (average 2d2h) leave out carry. This mechanism duplicates turtle ports already tested on other symbols. Before optimizing, check the impact model on stop fills and the result in calm and normal regimes, where Sharpe was -2.8 and -1.9.

Backtest Review

Sharpe
-1.59
Total return
-36.24%
Max drawdown
36.52%
Trades
236
Win rate
18.2%
Profit factor
0.55

QA re-derived the signal direction from the source and it is correct: buy stops sit above the 20-bar high and sell stops below the 20-bar low.

The sample is reliable: 236 closed positions (119 long, 117 short) over 799 days, metrics_reliable=true, accounting reconciles, and end_unrealized_pct=0.

Beta is 0.016 and correlation with buy-and-hold is 0.105. The result is not hidden market exposure, so the beta check in lesson 170 does not apply.

Per-trade return is -1.88% of notional against Hyperliquid's +0.15% floor (round trip about 0.09%). That is below the floor by more than 2 percentage points.

Sharpe is -1.59, and the bootstrap 95% CI is [-3.03, -0.27], entirely below zero. PSR is 0.022. On 236 trades, this falsifies the edge (lesson 141).

Profit factor is 0.545 and win rate is 0.182. Average win is $1,011 and average loss is $413, so the payoff is about 2.45:1. A trend follower at an 18% hit rate needs roughly 4.5:1 to break even, and this falls well short (lesson 142 shape).

Costs do not explain the loss, contrary to QA's framing. Net PnL is about -$36.2k (236 × -$153.6). Adding back the $10.9k modeled impact and $3.5k commission still leaves gross PnL around -$21.8k. The signal loses money before any execution cost.

It lost money in every year (2024 -7.3%, 2025 -25.6%, 2026 -7.5%) and in every volatility regime (calm Sharpe -2.85, normal -1.95, stressed -0.64). Max drawdown is 36.5% against the pre-registered 15%, and the drawdown lasted 777 days.

The signal-research diagnostic agrees: IC -0.018 (t=-1.2), verdict rejected_no_information.

Iteration History

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

Outcome Summary

The 20/10 Donchian turtle signal loses money on 4h LTC Hyperliquid before any costs (IC -0.018, not distinguishable from noise), so fixed-default turtle ports should not be expected to have an edge on these symbols and timeframes.

The analyst abandoned it at backtest review, before optimization, because expectancy was negative on a reliable sample and per-trade return was far below the +0.15% Hyperliquid floor. Even with the $10.9k impact and $3.5k commission added back, gross PnL was still about -$21.8k, and the optimization plan had no tunable parameters to change.

A faithful port of 用Python的交易员's Howtrader TurtleSignalStrategy: long and short 20-bar Donchian breakout stop-order ladders with a 10-bar exit channel and 20-period ATR, run on LTCUSD.HYPERLIQUID 4-hour bars with fixed source defaults and capital-relative sizing.

Over 799 days and 236 closed trades (119 long, 117 short), it returned -36.2% with a Sharpe of -1.59 (95% CI -3.03 to -0.27), profit factor 0.545, win rate 18.2%, average return per trade -1.88% of notional and max drawdown 36.5%. It lost money in every year and in every volatility regime.

Analysis

TurtleSignalStrategy

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