Skip to content
All strategies

Strategies

FMZ-Inspired LTC/BCH Five-Level Range Grid with Capped Inventory

Outcome: Abandoned

LtcBchFiveLevelCappedGrid

Outcome Summary

LtcBchFiveLevelCappedGrid tested an FMZ-inspired five-level range grid on LTC and BCH perpetuals, swapping martingale sizing for capped, capital-relative tranches. It went through 3 iterations but never passed code verification: the Layer 3 sandbox smoke test kept exceeding the 300s limit on a 2,400-day 4-hour LTC Hyperliquid window. No backtest, optimization, analyst or risk review was produced, so the grid's economics were never measured before the run was abandoned.

Hypothesis

Test the source's concrete mechanism: construct five evenly spaced levels from the preceding 3–5 days' trading range, enter against excursions, take profits after half a grid interval, and liquidate on a range break. Adapt it to independent LTC and BCH perpetual grids using 4-HOUR bars. Replace exponential martingale sizing with equal, capital-relative tranches and a fixed loss budget. Each instrument may hold only one inventory direction at a time, consistent with Hyperliquid's netting account. This is an experiment in compensated inventory provision, not an assumption that grids inherently generate profits.

The source supplies executable range, order-count, profit-taking and stop concepts, although its return claims are unverified. Hyperliquid is underrepresented at 7.7% versus its 20% target; this proposal also adds multiple instruments and both trading directions. corpus_concentration is empty, so neither symbol's recent research share can be verified. Avoid BTC and the existing ETH five-minute grid. Options are underrepresented but their recorded structural failures make them unsuitable for this source adaptation. No cross-venue hedge is introduced without a source-supported mechanism.

verification_loop: sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of LTCUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Implementation

Independent LTC and BCH Hyperliquid perp five-level range grids on 4H bars. The range is the high/low of the prior range_lookback_bars bars (excluding the current one), split into five evenly spaced levels. The strategy enters against an excursion through the inner level (long below low+step, short above high-step), but only in low-efficiency (non-trending) ranges. It adds at most one equal tranche at the range edge. It takes profit after half a grid interval and liquidates on a range break of half a step beyond the range, when the fixed loss budget is reached, or at the max cycle time. A cooldown follows each cycle. Each instrument holds one direction at a time, with no martingale.

Iteration 3 fixes the Layer-3 sandbox_timeout. The cause is plumbing (lesson 155 option c, diagnosed), not per-bar strategy cost. A local BacktestRunner run of the previous code (LTC+BCH 4H, 2024-01-01 to 2026-04-17) took 249s wall-clock, and the re-run took 321s. py-spy showed almost all of it inside ParquetDataCatalog.bars(), where fsspec globs the 133,595 bar directories. A single bars() query for LTCUSD.HYPERLIQUID-4-HOUR took 58.4s alone, and this two-leg config makes several such queries. The strategy……Show moreShow less

Iteration 3 fixes the Layer-3 sandbox_timeout. The cause is plumbing (lesson 155 option c, diagnosed), not per-bar strategy cost. A local BacktestRunner run of the previous code (LTC+BCH 4H, 2024-01-01 to 2026-04-17) took 249s wall-clock, and the re-run took 321s. py-spy showed almost all of it inside ParquetDataCatalog.bars(), where fsspec globs the 133,595 bar directories. A single bars() query for LTCUSD.HYPERLIQUID-4-HOUR took 58.4s alone, and this two-leg config makes several such queries. The strategy itself is O(range_lookback_bars ≤ 30) per bar with capped buffers, roughly 15s over ~10k bars. Code change, behaviour-neutral: the range/efficiency rebuild is now skipped while in cooldown, as well as while in a position (entries are gated on both). The re-run reproduced identical results: 253 trades, PF 0.797, total return -2.08%, max DD 2.64%, avg_trade_return_pct 0.103%. If Layer 3 still times out, the fix is catalog scan cost (one batched or indexed query), not strategy code. Honest note: at baseline parameters, the local in-window result shows no edge (PF < 1). The optimization plan's tunables (max_efficiency, range_lookback_bars) are the only remaining levers.

Verification Results

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of LTCUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Outcome Summary

Before resubmitting, profile per-bar cost on the full ~20k-bar sandbox window, including the base-template bar buffers and the multi-instrument dispatch, not just the strategy's own lookback, because code that claims O(lookback) per-bar work can still time out.

After 3 iterations it was abandoned in the verification loop. The Layer 3 sandbox backtest exceeded the 300s wall-clock limit on a ~20,000-bar window (2,400 days of LTCUSD.HYPERLIQUID 4-hour bars). Backtest review, optimization, analyst review and risk review were never reached.

Run independent five-level range grids on LTC and BCH perpetuals using 4-hour bars: build the levels from the prior 3–5 days' range, enter against excursions, take profit at half a grid interval and liquidate on a range break, with equal capital-relative tranches, a fixed loss budget and one inventory direction per instrument instead of martingale sizing.

There are no performance numbers. The backtest report is empty, no optimization ran, and the strategy never produced a return, Sharpe ratio or trade count.

Analysis

浅谈网格交易法

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