Skip to content

View original

EthRangingRegimeVolBandMeanReversionLS1H

Hypotheses

Ranging-Regime Volatility-Band Mean Reversion, Long-Short (Single-Instrument ETHUSDT Binance USD-M, 1H Bars, Fade Stretched Deviations ONLY When a Trend Filter Confirms No-Trend — the Documented Fix to Reversal-Fails-on-Trending-Majors, Few-Parameter)

Hypotheses

A LONG-SHORT, SINGLE-INSTRUMENT mean-reversion strategy on ETHUSDT.BINANCE (USD-M perpetual, 1-HOUR bars) that is deliberately engineered AROUND the factory's repeatedly-confirmed finding that 'short-term reversal does not exist on liquid majors — at that horizon these names continue/trend.' The prior cross-sectional 3-day reversal book failed precisely because it faded UNCONDITIONALLY and was therefore structurally short the momentum that dominates the universe. This strategy fixes that root cause with a hard REGIME GATE: it only fades a stretched deviation when a trend filter (ADX) says the asset is currently NOT trending. In a no-trend (ranging) regime, hourly overextensions from a short moving average revert; in a trending regime the strategy stays FLAT and never fights the trend. It is orthogonal to (and a deliberate complement of) the momentum/impulse/trend family that already dominates the portfolio — it harvests the OPPOSITE regime rather than re-expressing the same edge. Pure OHLCV, deep multi-year history, high trade count (no sparsity wall), single liquid major (no news-driven single-alt event-gap risk like XRP/LTC). Few parameters to resist overfitting.

Hypotheses

Iteration 3 fix for the Layer-3 wall-clock timeout: the previous version rebuilt numpy arrays from the ENTIRE growing bar history and ran the ADX Python loops over all of it on every bar, giving O(n^2) total cost that blew the 300s smoke-test limit on multi-year 1H data. The smallest surgical change slices self._bars to a fixed-length tail (self._calc_window = max(band_period, 5*adx_period)+10 = 80 bars) before building the arrays, so per-bar work is O(1) and total is O(n). All signal/entry/exit/sizing logic is byte-identical to the code that already passed Layers 1-2, so no earlier check regresses. The window comfortably covers the ADX Wilder warmup (2*adx_period+1) and the SMA band period.

Hypotheses

Fundamentally dead premise, not a fixable bug or an artifact — confirms the factory's repeatedly-validated finding that short-term reversal does not exist on liquid majors. This hypothesis's whole thesis was that an ADX no-trend regime gate would rescue the hourly ETH fade; the gated fade still loses in EVERY year (2020 through 2026) and EVERY regime, with total_return -85.7%, Sharpe -1.94 (entire CI negative, ci_high -1.14), PSR 0.0, profit_factor 0.72, and expectancy -$60.76 across a large, statistically meaningful 1,388-trade sample. The code faithfully implements the premise (no degenerate no-op parameter, no accounting artifact, plausible ~20% vol and no impossible days), so there is nothing for the developer to fix and no untuned lever for the optimizer to find — a 2-hour optimization from a base this uniformly negative would only fit noise. The 2-std z-score fade signal, even gated to ADX<25 ranging regimes, has negative predictive value on ETH; the strategy also carries the inverted small-TP (exit_z 0.3) / large-stop (4%) geometry the hypothesis claimed to avoid (avg_win $290 < avg_loss $455). Not iterate: no specific code defect exists and reframing the same contrarian mechanism onto another liquid major would re-express the same no-reversal failure. Matches known failure pattern: gated short-term mean reversion on liquid crypto majors does not generalize to a positive edge.

Implementation

Long-short 1H mean-reversion on ETHUSDT USD-M perp. Fades stretched z-score deviations from a 24-bar SMA band, but ONLY when ADX(14) < 25 (no-trend/ranging regime). Stays flat in trending regimes and exits if trend turns on mid-trade. Stop-loss and mean-recovery exits. Per-bar computation is bounded to a fixed recent window so the backtest runs in O(n) time.

Verification Results

Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit. 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).

Backtest Review

Clean, faithful implementation: the ADX regime gate, z-score fade, and stop/exit logic all correctly express the stated hypothesis (no artifact, no accounting bug, plausible vol 20.6% and no impossible days).

Backtest Review

Healthy sample and infrastructure: 1,388 trades over 6+ years, high trade count, single liquid instrument, O(1) per-bar cost — the backtest itself is trustworthy.

Backtest Review

The negative result is itself informative: it cleanly confirms the no-reversal-on-majors prior with a large statistically meaningful sample.

Backtest Review

Consistently negative edge across EVERY year (2020 -13%, 2021 -52%, 2022 -32%, 2023 -2.8%, 2024 -5.8%, 2025 -25.6%, 2026 -18.4%) and every regime — total_return -85.7%, max_drawdown 86.8%.

Backtest Review

Deeply negative risk-adjusted metrics with no ambiguity: Sharpe -1.94 (entire CI negative, ci_high -1.14), Sortino -2.46, PSR 0.0, profit_factor 0.72, information_ratio -1.01, expectancy -$60.76/trade over 1,388 trades.

Backtest Review

Inverted payoff geometry the hypothesis claimed to avoid: exit_z=0.3 (tiny win) vs 4% stop gives avg_win $290 < avg_loss $455 at 53% win rate; 16% of gross eaten by commission — but even correct geometry won't rescue a signal with no predictive edge across 6 years.

Outcome Summary

This strategy set out to rescue hourly ETH mean reversion from the factory's repeatedly-confirmed finding that short-term reversal fails on liquid majors, using a hard ADX regime gate to fade z-score overextensions only in ranging markets. Backtested over 1,388 trades and 6+ years, the gated fade lost in every single year and regime — total return -85.7%, Sharpe -1.94 with a fully negative confidence interval, profit factor 0.72, and expectancy -$60.76 per trade — while carrying the very inverted small-take-profit/large-stop geometry the hypothesis claimed to avoid. Because the implementation was clean and the negative result unambiguous across a large statistically meaningful sample, the analyst abandoned it at the pre-optimization backtest-review gate rather than spend hours optimizing noise. It never advanced past that gate: optimization, post-optimization analysis, and risk review were never run, and the outcome cleanly reconfirms that a contrarian ADX-gated fade on liquid crypto majors does not generalize to a positive edge.

Outcome Summary

Short-term reversal has no positive edge on liquid crypto majors even when gated to an ADX no-trend regime, so an overextension fade on ETH still loses across all years and regimes.

Outcome Summary

The analyst issued an 'abandon' verdict at the pre-optimization BACKTEST_REVIEW gate, ruling it a fundamentally dead premise rather than a fixable bug; the code faithfully implemented the hypothesis with a clean, trustworthy backtest, so there was no defect to fix and no untuned lever for optimization to find. Optimization, later analyst review, and risk review were never reached.

Outcome Summary

A long-short 1H mean-reversion strategy on ETHUSDT Binance USD-M perp that faded stretched z-score deviations from a short SMA, but only when an ADX trend filter (ADX<25) confirmed a no-trend/ranging regime, staying flat during trends to avoid fighting momentum.

Outcome Summary

Over 1,388 trades across 6+ years (2019-2026) it lost decisively: total return -85.7%, Sharpe -1.94 (entire CI negative, ci_high -1.14), profit factor 0.72, expectancy -$60.76/trade, and 86.8% max drawdown at a 52.9% win rate. It was negative in every year and every regime, with inverted payoff geometry (avg win $290 < avg loss $455) and ~16% of gross eaten by commission.

Iteration History

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['exit_z', 'entry_z', 'risk_frac', 'adx_period', 'band_period', 'min_notional', 'adx_threshold', 'stop_loss_pct'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: 'float' object is not callable (bar timestamp: 1735691580000) - steady_downtrend: TypeError: 'float' object is not callable (bar timestamp: 1735691580000) - flat_ranging: TypeError: 'float' object is not callable (bar timestamp: 1735691580000) - volatility_spike: TypeError: 'float' object is not callable (bar timestamp: 1735691580000) - zero_volume: TypeError: 'float' object is not callable (bar timestamp: 1735691580000) - price_gap: TypeError: 'float' object is not callable (bar timestamp: 1735691580000)
Strategy report

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