XrpRollingRegressionSlopeTrendLS
Hypotheses
XRP Binance USD-M Rolling-Regression Slope Trend — Long-Short, Trade the Sign of a Fast Log-Price Regression Slope Confirmed by a Slower Slope, Vol-Scaled + Notional-Capped to Tame Fat Tails, ATR Trailing Exit (3-Parameter)
Hypotheses
A LONG-SHORT, single-instrument, pure-price DIRECTIONAL TREND follower on XRPUSDT.BINANCE (USD-M perpetual) that DELIBERATELY changes the trend ESTIMATOR away from the EMA-cross confluence family I have already saturated (BTC/ETH/SOL/LINK/AVAX/ADA/BNB). Instead of an EMA crossover, the signal is the SLOPE of a rolling ordinary-least-squares regression of LOG-price — a smoother, noise-averaged trend estimate that is less whipsaw-prone than EMA crosses and far less outlier-driven than Donchian breakouts (the L9/L41 outlier-mirage class). Two evidence-driven choices target the exact failure modes seen across my trail: (1) VENUE = Binance, which has ~5–6y of XRP 4H history — enough sample for the bootstrap-Sharpe CI to lift off zero and the deflated Sharpe to clear the best-of-N bar, the gate that killed every short-history Hyperliquid port ('unestablished edge, wrong venue/data'); (2) ASSET = XRP, chosen because it has the LARGEST sustained directional trends among the liquid majors (multi-week/month moves), which gives wide per-trade fee margin — BUT its returns are fat-tailed, the reason the earlier naive 'XRP market-structure swing' died as an outlier-mirage. This proposal explicitly engineers against that: volatility-scaled sizing DOWNSIZES into volatility spikes and a hard per-trade notional cap prevents any single bar from dominating equity, converting XRP's big trends into distributed edge rather than one-day mirages. NOT a mean-reversion fade (L53), NOT a squeeze breakout (L54), NOT a channel breakout (outlier class), NOT a cross-sectional/per-name-ensemble basket (L52), NOT a market-neutral ratio (just died at near-zero edge), NOT a non-price-feed gate (L46), NOT options/COIN-M (L50/L51). Fills the long-short direction gap (13.7% vs an 86% long-only book) and adds a fresh non-major name + a NEW estimator to the book. Risk profile: ~1.5% equity risk per trade via ATR stop; vol-scaled sizing (notional = risk_budget / (atr_mult * ATR_4H)) hard-capped at 25% of equity*leverage per position; 2x leverage cap (reads self.config.leverage). Exactly 3 tunable parameters (fast regression window, slow regression window, ATR trailing multiple).
Hypotheses
Implements the hypothesis exactly: a NEW estimator (rolling OLS slope of log price, fast confirmed by slow) rather than another EMA-cross re-skin, on XRP at Binance USD-M for the ~6.6 years of 4H history (14422 bars, 2020-01-06 to 2026-08-05) that the short Hyperliquid ports lacked. Single bar type, no extra legs -- nothing to mis-wire. Exactly 3 tunables (fast_window, slow_window, trail_atr_mult); code clamps mirror _param_bounds verbatim and additionally force slow > fast. Long-short fills the direction gap; leverage 2.0 is genuinely consumed in the notional cap (equity * max_notional_frac * self.config.leverage), and both the vol-scaled size and the cap are fractions of CURRENT equity, which is the concrete fat-tail engineering the hypothesis asked for -- the position shrinks into volatility spikes instead of scaling with them. VERIFIED BEFORE SUBMITTING by replaying THIS EXACT CLASS over the full real catalog series with Binance USD-M taker fees (0.10% round trip): 350 round trips (~53/yr, so walk-forward windows populate; a 15-day holdout expects ~2 trades), avg +1.40% per trade NET of fees (14x the fee cost, 9x the 0.15% viability floor), 42% win rate, profit factor 1.53, and +0.22%/trade over the trailing 365 days. Yearly avg/trade: 2020 +3.52%, 2021 +3.41%, 2022 -0.24%, 2023 +0.16%, 2024 +2.18%, 2025 +0.31%, 2026 YTD +0.38% -- positive in six of seven calendar years, with 2022 mildly negative. Every setting inside the declared bounds is profitable full-sample (avg +0.65% to +1.65%, PF 1.30-1.67), and the defaults are the exact CENTRE of the declared bounds rather than the grid maximum. TWO HONEST CAVEATS: (1) the claim that this estimator is materially less outlier-driven is only partly borne out -- trade-return kurtosis is 39.9 and the top-3 trades are 21.7% of gross profit at the defaults, versus kurtosis 17 / top-3 11% for the same-family ADA EMA-confluence run, so the OLS slope smooths the SIGNAL but XRP's price tails still come through the returns; the vol-scaled sizing and notional cap bound the equity impact but do not remove return kurtosis, so the deflated-Sharpe gate may still bite. (2) The edge is weaker than the EMA-confluence siblings on the same venue (PF 1.53 vs 2.0-2.6), i.e. the new estimator diversifies the book rather than improving it. Per-bar work is O(1) (rolling regression sums updated in constant time, bounded deques), so the 300s Layer-3 cap is safe; all six Layer-2 synthetic scenarios pass locally with a continuous, varying signal.
Hypotheses
The long-history venue and the new OLS-slope estimator did not reveal an edge because XRP slope-trend does not have one. Sharpe is only 0.28 with a bootstrap CI [-0.36, 0.88] that straddles zero deeply — and this is NOT the short-sample problem the hypothesis targeted: with 348 trades over 6.6 years of Binance data, the edge simply failed to lift off zero, so it is weak, not un-measured. profit_factor is 1.17 (fee-edge zone) and on a meaningful benchmark it underperforms buy-hold XRP (alpha 0.029, information_ratio -0.54). The return is front-loaded (2020 +15.3%, 2021 +12.5% carry it; 2022 -5.7% and 2023/2024 near-flat, rolling_sharpe negative much of 2022-2024). It is also thin/impacted (impact_cost_pct 12.2%, capacity ~$6.7M) with a 24.2% drawdown (CI to 47.6%), and XRP single-name alt trend is the L41 0/213 class (the earlier XRP swing died as an outlier-mirage). Unlike the ADA (Sharpe 1.54) and BNB (Sharpe 0.97) Binance ports, which established significant edges because the asset/mechanism had one, this XRP slope-trend has no edge to optimize toward — best-of-N over ~225 trials on a Sharpe-0.28 base cannot clear deflated Sharpe. Abandon rather than spend the optimization budget.
Implementation
Long-short, single-instrument directional trend follower on XRPUSDT.BINANCE USD-M perpetual, 4H bars, using a rolling ORDINARY-LEAST-SQUARES slope of log price as the trend estimator instead of an EMA cross or a channel breakout. Two slopes are maintained in O(1) per bar from rolling sums: a fast one over 48 bars (~8 days) and a slow confirmation slope over 144 bars (~24 days). calculate_signal returns fast_slope / (ATR/close) -- the fast trend expressed in per-bar volatility units, continuous and varying every bar. ENTRY only when the fast and slow slopes share a sign (LONG rising, SHORT falling); disagreement means FLAT. EXIT on a 3x-ATR trailing stop from the best close since entry, or on either slope flipping against the position. Sizing is volatility-scaled (qty = equity*1.5%/(3*ATR), so positions shrink as ATR expands) and hard-capped at 25% of equity x 2x leverage.
Verification Results
Analyst/backtest_review: confirm edge survives walk-forward OOS and the 15-day holdout, isn't carried by the 2020-2021 bull tail, and clears the deflated-Sharpe gate; weight the trailing-365-day result heavily.
Verification Results
Pure-OHLCV long-short directional trend follower (rolling OLS log-price slope). Per L7, pure-OHLCV strategies have ~0% historical survival to risk review. Code is correct and measurable, but the sandbox is weak: Sharpe 0.268 with a bootstrap CI [-1.54, 1.76] straddling zero, PF 1.18, return_skew 1.80, kurtosis 16.0, and the developer concedes edge is weaker than the EMA-confluence siblings (PF 1.53 vs 2.0-2.6) with only +0.22%/trade over the trailing 365 days.
Verification Results
Analyst: evaluate on realized trade-return distribution (kurtosis, top-N concentration) rather than the assumed smoothness of the estimator.
Verification Results
The hypothesis's core rationale (OLS slope tames XRP fat tails into distributed edge) is only partly borne out per the developer's own caveat: full-sample trade-return kurtosis 39.9 and top-3 trades = 21.7% of gross profit. Vol-scaling bounds equity impact but does not remove return kurtosis. Code implements the mechanism as described; the premise should be judged on distribution stats, not assumed.
Verification Results
For live deployment, persist _side/_extreme/_entry_atr or reconstruct from the actual open position rather than from the current signal.
Verification Results
should_exit() infers _side from the live signal sign on restart (_side==0) and re-seeds _entry_atr/_extreme from current values. Unreachable in backtest; only a live mid-position crash-restart risk, where it could pick the wrong side or reset the trailing reference.
Backtest Review
Large measurable sample (348 trades, 6.6 years) on the long-history venue; novel OLS-slope estimator; fat-tail control kept kurtosis moderate (11.6) and skew 0.57
Backtest Review
No significant edge: Sharpe 0.28 with CI [-0.36, 0.88] straddling zero deeply — the long-history venue gave ample sample yet the edge did not lift off zero (weak edge, not small sample)
Backtest Review
Fee-edge zone and underperforms buy-hold XRP: profit_factor 1.17, alpha 0.029, information_ratio -0.54
Backtest Review
Front-loaded/decayed edge: ~all return is 2020-2021; 2022 -5.7% and 2023/2024 near-flat; rolling_sharpe negative much of 2022-2024
Backtest Review
Thin/impacted: impact_cost_pct 12.2%, capacity ~$6.7M, max_drawdown 24.2% (CI to 47.6%); XRP single-name alt trend is the L41 0/213 class
Outcome Summary
XrpRollingRegressionSlopeTrendLS changed the trend estimator to a rolling OLS log-price slope and paired it with volatility-scaled sizing and a notional cap to convert XRP's big fat-tailed trends into distributed edge, deliberately choosing Binance's long history to clear the significance gate that had killed short-history Hyperliquid ports. The fat-tail control worked (kurtosis 11.6) and the sample was ample (348 trades over 6.6 years), but the edge never materialized: Sharpe 0.28 with a CI straddling zero, profit factor 1.17, a -0.54 information ratio versus holding XRP, and returns carried entirely by 2020-2021 with flat-to-negative years since. The analyst abandoned it at backtest review, concluding the long venue and new estimator conclusively showed XRP slope-trend has no edge (weak, not un-measured), unlike the ADA and BNB Binance ports that did establish one; it never reached optimization, analysis, or risk review.
Outcome Summary
Fixing the data problem (long history) and swapping in a smoother, less outlier-prone estimator successfully rules out short-sample and outlier-mirage explanations — but that only proves the absence of edge more conclusively: XRP slope-trend simply has no edge to optimize toward, front-loaded into 2020-2021 and underperforming buy-and-hold since.
Outcome Summary
The analyst abandoned it at backtest review: unlike the short-history Hyperliquid ports, this had ample sample (348 trades over 6.6 years) yet the edge still failed to lift off zero, so it is genuinely weak, not un-measured — profit factor in the fee-edge zone, underperforming buy-and-hold XRP, front-loaded and decayed, thin (12.2% impact, ~$6.7M capacity), in the L41 0/213 single-name alt-trend class. A Sharpe-0.28 base cannot clear deflated Sharpe under best-of-N optimization.
Outcome Summary
A long-short, single-instrument directional trend follower on XRPUSDT.BINANCE USD-M 4H (3 parameters) that used the slope of a rolling OLS regression of log-price as its trend estimator — trading the sign of a fast slope confirmed by a slower slope — with volatility-scaled sizing and a hard notional cap to tame XRP's fat tails, and an ATR trailing exit, choosing Binance for its ~6-year history to establish significance.
Outcome Summary
The backtest (XRPUSDT.BINANCE 4H, 2403 data days, 2020-01 to 2026-08) returned +44.7% over 348 trades but with no significant edge: Sharpe 0.28 (CI [-0.36, 0.88] straddling zero deeply), profit factor 1.17, information ratio -0.54 versus holding XRP, alpha 0.029, max drawdown 24.2% (CI to 47.6%). The fat-tail control worked (kurtosis 11.6, skew 0.57), but the return was front-loaded — 2020-2021 carried it while 2022 lost -5.7% and 2023/2024 were near-flat.
Backtest and paper results are hypothetical. Trading involves risk of loss.