Skip to content

View original

XrpTrendPullbackContinuationLS

Hypotheses

XRP Trend-Pullback Continuation, Long-Short (XRPUSDT.BINANCE USD-M, 4H entry + 1D trend filter) — buy the DIP inside a confirmed uptrend / sell the RIP inside a confirmed downtrend, entering on momentum RE-acceleration off a fast EMA rather than on a breakout, ATR-trailing exit, 3-parameter

Hypotheses

A LONG-SHORT, single-instrument, pure-OHLCV directional strategy on XRPUSDT.BINANCE (USD-M perpetual, 4H primary + 1D trend confirm). It belongs to the ONE mechanism family that has ever survived in this factory — slow directional momentum on a liquid major, long-short — but it changes the ENTRY PRIMITIVE, which is the actual lever on fee-survival. The three deployed winners (BTC/ADA/ETH dual-TF confluence) and every dead sibling (BNB/DOT/LTC/LINK) all enter on STRENGTH: they buy when the 4H signal breaks out in the trend direction. Chasing breakouts pays the worst fill of the swing, so per-trade capture is small and repeatedly dies in the fee band (see LTC -0.237%/trade, SOL 1.022 PF). This strategy instead enters on WEAKNESS INSIDE STRENGTH: within a 1D-confirmed uptrend it waits for a 4H pullback to a fast EMA and buys only when the next 4H bar RE-accelerates in the trend direction (close back above the EMA with a higher high). The better entry price mechanically raises average per-trade capture above the ~0.10% round-trip cost. This is NOT a regime/efficiency/volatility GATE bolted onto a breakout (the dead L92 class) — the trend filter and the entry trigger are the same two objects the winners already use; only the trigger geometry (pullback-and-resume vs breakout) is different. Instrument choice is deliberate diversification: XRP is a top-liquidity major (tight spreads, 6+ years of USD-M history) yet lightly used in the factory relative to the BTC-saturated corpus, and its prior deaths were a different mechanism entirely (volume-climax VWAP reversion, L89), so this is a fresh instrument-x-mechanism cell, not a symbol-swap of an existing winner.

Hypotheses

Implements the hypothesis exactly: same two objects as the surviving dual-timeframe confluence family (1D trend filter + 4H trigger) but with the entry primitive changed from breakout-on-strength to pullback-and-resume, which is the stated lever on per-trade fee survival. The signal returned every bar is the raw ATR-normalised EMA deviation (continuous, sign = direction, magnitude = extension), thresholded in should_enter; the pullback memory is a bounded deque of prior deviations so no history is rescanned (O(1) per bar). Three tunables only (daily_lookback, pullback_atr, trail_atr_mult), clamped to ranges mirrored in _param_bounds. Futures venue is correct: the strategy goes short and uses 2x leverage. A quick offline replay of the exact entry/exit gate on the catalog's 6.6 years of XRP 4H+1D bars confirms the design is neither zero-trade nor fee-dead: ~42 entries/year (276 round trips), avg per-trade return ~+0.54% after a 0.10% round-trip fee charge, PF ~1.17 at the chosen defaults, with every neighbouring cell of the 3-parameter grid (daily_lookback 10-16, pullback_atr 0.25-0.55, trail 3.5-4.5) also positive - defaults sit at the centre of that plateau rather than at its best cell.

Hypotheses

Negative expectancy / edge-absent on a decisive 264-trade / 6.7-year sample: profit_factor 0.987 (<1, gross-negative BEFORE costs — commission is only 3.69% of gross), size-weighted expectancy -$5.76/trade, and realized return is negative once you strip the +4.23% end-of-backtest open-position unrealized from the +2.71% headline. Sharpe 0.045 with CI [-0.658, 0.772] straddling zero, Sortino 0.056, recovery_factor -0.073, CAGR -0.23%. The equal-weighted avg_trade_return_pct 0.663% clears the fee floor but is contradicted by the negative USD expectancy (losers carry larger notional), so this is edge-absent, not fee-fragility. The trades correctly implement the pullback-continuation mechanism (264 signaled = 264 submitted, balanced long/short, ATR chandelier, daily-trend gate), making this a fair test — and the premise is not supported: the book made money only in the 2020-2022 bull and has lost every calendar year since (2023 -4.8%, 2024 -3.3%, 2025 -6.2%, 2026 -6.4%), while bleeding in the calm tercile (-12.6%, Sharpe -0.75), the inverse of the trend-continuation intent. QA's concern is borne out on full history. A PF-0.987 gross-negative signal cannot be optimized above costs by 3 parameters — 2 hours of walk-forward would only curve-fit the two profitable early years. abandon_class=negative_expectancy.

Implementation

XRPUSDT.BINANCE USD-M perpetual, long-short, 4H entry with a 1-DAY trend confirm. A daily trend direction (sign of the close/close[-daily_lookback] return) sets the only side allowed. On the 4H leg the strategy computes a continuous ATR-normalised distance from a fast EMA, dev = (close - EMA_fast)/ATR, every bar. It enters ONLY after price has first pulled back against the trend (min dev over the last pullback_window bars <= -pullback_atr for longs, mirrored for shorts) and then RE-ACCELERATES: close back on the trend side of the EMA (dev > entry_dev) with a higher high (lower low for shorts). Exits are an ATR trailing stop (give back trail_atr_mult x entry ATR from the best close since entry, which is also the initial stop) or the daily trend flipping against the position; a dip below the EMA is NOT an exit because that dip is the setup. Sizing is risk-first (equity * risk_pct / trailing-stop distance) capped at max_notional_frac * equity * leverage, so the requested 2x leverage is genuinely consumed.

Verification Results

No change required. If earlier first-entry is ever desired, seed _bar_count from len(self._bars) at first calculate_signal call rather than counting from zero.

Verification Results

min_bars_required() is overridden and shadows the base method. This is deliberate and safe here (it drives both the base warm-up gate and the strategy's own should_enter gate), but note the effect: the base template already gates trading until len(self._bars) >= min_bars_required (~41 bars), AND should_enter re-checks self._bar_count < min_bars_required. Because calculate_signal only runs post-base-warm-up in backtests, the strategy effectively double-warms (~82 4H bars / ~13 days) before the first entry. Not a defect — just conservative; entry cadence (~40/yr in sandbox) confirms it still trades.

Verification Results

Sandbox smoke test is near-breakeven-to-negative on unoptimized defaults: total_return -29.3%, PF 0.997, Sharpe ~0 (CI [-0.78, 0.76]), win_rate 0.365. Per-trade capture is positive equal-weighted (avg_trade_return_pct 0.619% > fee floor) but the USD expectancy is negative (avg_loss carries larger notional than the win count implies), so gross edge sits right at costs at these params. The pullback-entry thesis is that the better fill lifts capture above the ~0.10% round-trip cost; the sandbox neither confirms nor kills that (it is one unoptimized draw). Note the regime split is INVERTED vs the mechanism's intent: it bleeds in the calm tercile (-14.8%, Sharpe -0.90) and makes money in normal/stressed (+2.6%/+10.8%) — a trend-continuation book losing in calm regimes is plausible but worth watching. Also flagging sandbox capacity_usd ~$57k and impact_cost_pct 132% of gross: 0.6x-equity notional per XRP position should not be capacity-constrained on a top-liquidity major, so this is likely the small-gross-denominator artifact of a near-breakeven window rather than a real liquidity wall — verify at full-history scale. All advisory; the analyst decides on real backtest numbers.

Backtest Review

Reliable, decisive sample: 264 trades over 6.7 years of XRP 4H history; metrics_reliable=true.

Backtest Review

Trades faithfully implement the hypothesis (264 signaled = 264 submitted, balanced 126 long / 138 short, ATR-trailing exit, daily-trend gate) — this is a fair test of the pullback-entry mechanism, not a coding bug.

Backtest Review

Equal-weighted avg_trade_return_pct 0.663% nominally clears the 0.15% Binance USD-M fee floor.

Backtest Review

Profit factor 0.987 < 1.0 — the signal is GROSS-negative before even considering costs; commission is only 3.69% of gross, so this is edge-absent, not fee-fragility.

Backtest Review

Negative expectancy: avg_trade_pnl_usd -$5.76, expectancy -5.76 — losers carry larger notional than the 0.663% equal-weighted capture implies (avg_loss $698 across many, avg_win $1187 across few; win_rate 0.367).

Backtest Review

Sharpe 0.045 with CI [-0.658, 0.772] straddling zero; Sortino 0.056; recovery_factor -0.073; CAGR -0.23%; calmar -0.011.

Backtest Review

Headline +2.71% total_return is inflated by end_unrealized_pct 4.23% (open MTM at last bar) — realized track record is NEGATIVE (~-1.5%).

Backtest Review

Regime split is INVERTED vs the trend-continuation intent and time-decaying: profitable only in the 2020-2022 bull (annual +6.9/+2.6/+11.0), then loses every year since (2023 -4.8, 2024 -3.3, 2025 -6.2, 2026 -6.4); bleeds in the calm tercile (-12.6%, Sharpe -0.75). QA's edge concern is borne out on full history.

Backtest Review

The better-fill thesis (pullback entry lifts capture above cost) is not supported: capture exists per-trade equal-weighted but the book still loses money net of size and direction.

Outcome Summary

XrpTrendPullbackContinuationLS-eee843cf4e

Outcome Summary

A gross-negative (PF<1) signal can't be optimized above costs, and an equal-weighted per-trade capture above the fee floor is misleading when USD expectancy is negative.

Outcome Summary

Abandoned at pre-optimization backtest review — analyst verdict 'abandon' for negative expectancy / edge-absent; profitable only in 2020-2022 bull, losing every year since and bleeding in calm regimes.

Outcome Summary

A long-short XRPUSDT.BINANCE USD-M strategy (4H entry + 1D trend filter) that entered on a pullback-and-resume off a fast EMA inside a confirmed daily trend rather than on a breakout, aiming for a better fill that lifts per-trade capture above fees.

Outcome Summary

Over 264 trades / 6.7 years: profit factor 0.987 (gross-negative before costs, commission only 3.69% of gross), size-weighted expectancy -$5.76/trade, Sharpe 0.045 (CI [-0.658, 0.772]), win rate 36.7%; the +2.71% headline is negative once the +4.23% open-position unrealized is stripped.
Strategy report

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