Skip to content

View translation

XrpRangeReversionDailyFlatnessGatedLS

Hypotheses

XRP Range-Reversion Gated by a Slow Trend-Flatness Regime — Long-Short, Dual-Timeframe: FADE 4H Overextensions Back to the Mean ONLY When the DAILY Trend Is FLAT (Non-Trending Regime), Stand Aside / Stop Out When the Daily Trend Re-Ignites (XRPUSDT.BINANCE USD-M, Daily-Regime + 4H-Execution, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument, PURE-OHLCV mean-reversion strategy that is deliberately the STRUCTURAL MIRROR of the factory's only promoted strategy (BTC dual-timeframe momentum): it uses the SLOW timeframe (daily) to classify the REGIME and the FAST timeframe (4H) to execute — but instead of FOLLOWING breakouts in trending regimes, it FADES overextensions in RANGE regimes. This directly fixes the exact flaw that killed the prior single-symbol reversion attempt (the AVAX 15m wick-fade): that strategy faded in ALL regimes and got run over during trends. Here, the daily trend-flatness gate ensures we only fade when the market is genuinely range-bound — the regime where mean-reversion has positive expectancy — and we HARD-STOP the moment the daily trend re-ignites against us. XRPUSDT is chosen deliberately: it is a liquid major with multi-year 4H+1D history (rock-solid OHLCV data — no trade-tick/options data-availability trap that unmeasurably killed the tick and options hypotheses this batch), and it is empirically the most RANGE-PRONE major (long flat consolidations punctuated by explosive moves), so the range-fade edge is strongest and the trend-break stop is essential. Daily/4H horizon keeps turnover low so per-trade capture dwarfs fees — the opposite of the sub-fee scalping graveyard. 3 parameters: daily-flatness (ADX) threshold, 4H entry z-score, and ATR stop multiple.

Hypotheses

Implements the hypothesis exactly: slow timeframe = REGIME (daily ADX flatness), fast timeframe = EXECUTION (4H z-score fade), long-short on futures (shorts required, so BINANCE USD-M rather than spot; leverage stays 1.0 because the risk-first sizing tops out at ~50% of equity notional and does not need margin). The daily regime is derived by UTC-calendar aggregation of the primary 4H bars instead of a second daily bar feed — six 4H bars per UTC day reproduce the daily OHLC exactly while keeping the strategy single-feed, removing the second-leg data-availability failure mode; the day boundary is a pure function of bar.ts_event, so the schedule is restart- and replay-invariant. The AVAX all-regime-fade flaw is fixed by the hard ADX gate on entry plus the explicit trend-re-ignition exit. All per-bar work is O(1) (running sums, bounded ATR deque, incremental Wilder smoothing), so the 300s smoke cap is safe, and entry frequency on real XRP 4H data is ~50/year (~300 trades over 6.5 years), well clear of the zero-trade trap. One honest caveat for the Analyst: an engine-free replay of these exact rules on the real XRPUSDT 4H series 2020-01..2026-08 with a 0.10% round trip charged shows the ADX gate direction is real (adx_flat_max ~20-22 beats 27-32 by 30-50 bps/trade everywhere in the grid, confirming fades only work in flat regimes), but no cell is statistically significant (best t ~ +0.70) and every positive cell is carried entirely by 2020-2023 while 2023-2026 is negative (e.g. the shipped-region cell z30/1.8/2.5/ADX22: +0.29% first half vs -0.19% second half) — I shipped defaults from the broad flat-regime region rather than the grid maximum, and flag that this hypothesis may be a pre-2023 artifact.

Hypotheses

Single-name mean-reversion fade (L55) with PF 0.82 and total_return -28.7% — abandon-at-review class. Net-negative expectancy (-$91.8/trade, avg_trade_return_pct -0.19%) with adverse payoff geometry (63.7% win rate but avg_loss ~2x avg_win, skew -0.77, tail_ratio 0.80) and losses in nearly every year (2022/2023/2024/2025 all negative). The daily-flatness regime gate — the intended fix for the prior AVAX fade — did not produce a positive edge; the loss is structural, not a tunable-threshold artifact, and re-tuning entry z / ATR stop has never rescued a sub-1.15-PF single-name fade over fees. Failure pattern: single_name_fade_negative_expectancy (PF<1.15, negative total return, avg_loss>>avg_win).

Implementation

XRPUSDT (Binance USD-M) long-short range reversion executed on 4H bars and gated by a DAILY trend-flatness regime. The daily leg (Wilder ADX(14) plus +DI/-DI, computed from UTC-calendar-day OHLC aggregated from the 4H stream and finalized only when a bar from a NEW day arrives, so it never peeks inside the unfinished day) classifies the regime: FLAT when daily ADX < adx_flat_max. The 4H leg returns a continuous z-score of close vs its rolling mean/std (z_lookback=30) every bar, computed from O(1) running sums. Entry fades overextensions ONLY in a flat daily regime: z <= -entry_z -> BUY, z >= +entry_z -> SELL. Exits: mean reached (|z| back inside exit_z), ATR stop (adverse excursion >= stop_atr_mult x entry ATR), daily trend re-ignition against the position (daily ADX > adx_flat_max + 8 AND the daily directional index opposes), or a 30-bar (5-day) time stop. Sizing is risk-first: qty = equity * 1.2% / (stop_atr_mult x ATR), capped at 50% of equity notional, so a losing streak cannot compound position size. Three tunables: adx_flat_max, entry_z, stop_atr_mult, each clamped to the range declared in _param_bounds.

Verification Results

Analyst should weigh whether the range-fade edge clears fees net over the full multi-year history given the asymmetric win/loss profile.

Verification Results

Sandbox backtest is marginally negative (total_return -1.15%, Sharpe -0.17, PF 0.94, expectancy -$32.6/trade) over the 362-day window despite a 61% win rate — the loss comes from asymmetric payoff (avg_loss $1434 vs avg_win $859): the ATR/time stops let losers run larger than the fade winners capture. Not a code defect (win_rate>0, |Sharpe|<5, PF>0 — no polarity/inverse-sizing signature); an edge-strength question for the Analyst.

Verification Results

Optimizer/Analyst should scrutinize the holdout and post-2023 OOS specifically; abandon if the recent half stays negative after optimization.

Verification Results

Developer's own caveat: no grid cell is statistically significant (best t ~ +0.70) and all positive expectancy is carried by 2020-2023 while 2023-2026 is negative (shipped cell +0.29% first half vs -0.19% second half) — likely a pre-2023 regime artifact / weak OOS.

Backtest Review

Clean single-feed implementation; the daily-flatness regime gate and trend-reignition stop are thoughtfully designed and fired (282 trades)

Backtest Review

Genuinely market-uncorrelated (beta -0.008), so it is not hidden directional exposure

Backtest Review

Losing strategy: total_return -28.7%, Sharpe -0.35, profit_factor 0.82, expectancy -$91.8/trade, avg_trade_return_pct -0.19% (net negative)

Backtest Review

Loses in nearly every year (2022 -5.7%, 2023 -10.6%, 2024 -6.1%, 2025 -10.8%) — not a single dodgeable regime

Backtest Review

Adverse geometry: 63.7% win rate but avg_loss ($1350) ≈ 2x avg_win ($654), tail_ratio 0.80, omega 0.89, skew -0.77 — the picking-up-pennies fade failure mode the regime gate was meant to prevent

Backtest Review

Single-name fade/reversion class (L55): re-tuning entry z / ATR stop has never lifted a sub-1.15-PF fade over fees

Backtest Review

Max drawdown 34.9% (CI high 60.7%), probabilistic_sharpe 0.14

Outcome Summary

XrpRangeReversionDailyFlatnessGatedLS tried to be the structural mirror of the factory's only promoted strategy — using the daily ADX regime to classify flatness and 4H z-scores to execute — fading XRP overextensions only in range-bound regimes and stopping out when the daily trend re-ignited, explicitly designed to fix the all-regime fading that killed the earlier AVAX wick-fade. The regime gate did fire (282 trades, genuinely market-uncorrelated at beta -0.008), but the strategy lost money: total_return -28.7%, Sharpe -0.35, PF 0.82, and a negative -$91.8/trade expectancy with losses in nearly every year and losers about twice the size of winners. The analyst abandoned it on the first iteration at the backtest_review gate, judging the negative expectancy structural rather than tunable and matching the single_name_fade_negative_expectancy failure pattern. It never advanced to optimization, analysis, or risk review.

Outcome Summary

A regime gate does not rescue a single-name mean-reversion fade whose per-trade expectancy is negative and whose losers are twice its winners — a high win rate paired with avg_loss >> avg_win is the picking-up-pennies failure mode the gate was supposed to prevent, and it recurs across the single-name fade class regardless of the regime filter.

Outcome Summary

It was abandoned at the pre-optimization backtest_review gate on iteration 1: the analyst issued an 'abandon' verdict because it is a losing single-name fade (PF 0.82, negative total return and expectancy) whose loss is structural rather than a tunable-threshold artifact — the daily-flatness regime gate meant to fix the prior AVAX fade did not produce a positive edge, and re-tuning entry z / ATR stop has never rescued a sub-1.15-PF single-name fade over fees.

Outcome Summary

A long-short, single-instrument, pure-OHLCV mean-reversion strategy on XRPUSDT.BINANCE USD-M that fades 4H overextensions (z-score) back to the mean but only when the daily ADX regime is flat (non-trending), hard-stopping when the daily trend re-ignites — a structural mirror of the promoted BTC dual-timeframe momentum recipe, with three parameters (daily-flatness ADX threshold, 4H entry z, ATR stop multiple).

Outcome Summary

The backtest was a net loss across 282 trades: total_return -28.7%, Sharpe -0.35, profit_factor 0.82, expectancy -$91.8/trade, and avg_trade_return_pct -0.19% (below the 0.15% floor), with max_drawdown 34.9%. Despite a 63.7% win rate the payoff geometry was adverse — avg_loss ($1350) was roughly twice avg_win ($654), skew -0.77, tail_ratio 0.80 — and it lost in nearly every year (2022 -5.7%, 2023 -10.6%, 2024 -6.1%, 2025 -10.8%).
Strategy report

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