BtcFundingRegimeTrendContinuationLS
Hypotheses
BTC Funding-Regime Trend Continuation, Long-Short (Single-Instrument BTCUSDT.BINANCE Perp — NEW Information Source: Hold WITH the Persistent FUNDING-RATE Regime (Sustained Positive = Bull Leverage / Negative = Bear) When Price Agrees, ATR-Trailing, 3-Parameter)
Hypotheses
A LONG-SHORT directional strategy on the BTCUSDT.BINANCE USD-M perpetual that trades WITH the persistent FUNDING-RATE REGIME — a new-information-source (funding) idea used in the CONTINUATION direction, per L38, and aligned with the one edge that survives (momentum/trend), unlike every BTC fade this session (funding-contrarian/deleveraging, liquidation, OI-divergence, DVOL/skew/term extremes — all dead). It is explicitly NOT the dead funding-CONTRARIAN (which faded funding extremes) and NOT the banned delta-neutral funding-CARRY (L33): it treats the SIGN and PERSISTENCE of funding as a leverage-sentiment REGIME and rides it directionally. Thesis: sustained POSITIVE funding means leveraged demand is persistently long (a bull regime that tends to continue); sustained NEGATIVE funding means persistent short/bear leverage. Holding a position aligned with the persistent funding regime AND the price trend captures the leverage-driven continuation, while disagreement (funding regime vs price) signals a fragile/transition state → flat. It uses a WELL-COVERED funding feed (no coverage ceiling like taker/L-S, no no-trades/no-edge like the options feeds), trades the liquid BTC perp (dev-safe, signal=execution), single instrument, long-short (fills the 13.5% bucket vs 86.5% long-only), 4H cadence for a measurable ~100-200 trade sample, ATR trail to ride continuation. 3 parameters.
Hypotheses
Iteration 3 fixes the exact Layer-3 failure ('should_enter returned a side 0 times over 2149 bars') with a single localized change in _funding_arrays. Root cause: the funding dict reaches the strategy in two different key forms. Layer 2's synthetic generator emits dual keys (int AND str), so my previous `if not isinstance(k, int): continue` filter worked there and Layer 2 passed; but the real Layer-3 feed is JSON-normalized in supp_collector.load_for_subprocess (`json.loads(json.dumps(supp))`, which explicitly 'keeps only their str keys'), so the int-only filter read an EMPTY series, _funding_persistence returned None on every bar, and calculate_signal was a constant 0.0 -> no entry ever fired. The parser now accepts int OR str keys and de-duplicates on the integer timestamp (so the dual-keyed Layer-2 form still yields one entry per settlement, keeping Layer 2 green), with a defensive s/ms->ns upcast. Second, smaller change: entry_threshold 0.35 -> 0.30 for margin on trade count. With p=+1 (BTC funding is positive most of the time) the 0.30 gate needs close to be only ~0.10 ATR above SMA30, which fires readily across a 2179-bar window. No other logic, imports, class structure, sizing, or exit code was touched, so Layers 1 and 2 stay passing; there is still NO price-only fallback when the funding feed is genuinely missing (the strategy stays flat rather than switching edge mechanism).
Hypotheses
OHLCV+funding momentum/continuation class (L9, zero survivors at PF < 1.2), and this result is decisively thin AND non-robust. profit_factor 1.11 (below the meaningful-edge line), Sharpe 0.434 with a 95% CI [-0.15, 1.11] that already straddles zero, and information_ratio -0.649. The long-short premise is falsified by its own trades: 247 long vs 51 short with short_win_rate 11.8% — the short leg does not work, so this is a long-biased momentum rider, not the long-short edge the hypothesis claimed. The apparent profit is an artifact of ~6 outlier bull days (kurtosis 19.3, skew 1.70): performance is deeply inconsistent across regimes (2022 -24.9%, 2026 -29.8%, recent rolling Sharpe ~ -13), and ~46% of the headline total_return is un-exited open-position unrealized (end_unrealized_pct 40.1). avg_trade_return_pct 0.322% clears the fee floor, so this is not fee-fragility — the problem is that the risk-adjusted edge is not distinguishable from zero and depends on tail days. Optimizing best-of-225 trials would overfit those outliers and near-certainly abandon-overfit in ANALYZING after burning 2 hours. Abandon rather than optimize.
Implementation
Long-short 4H directional strategy on the BTCUSDT.BINANCE perp that rides the persistent funding-rate regime instead of fading it. Funding persistence p = mean sign of the last ~3 days of 8h funding settlements (sustained positive = leveraged-long bull regime, sustained negative = bear regime); price trend u = tanh((close - SMA30)/ATR14). The signal is the agreement-weighted blend ((p+u)/2)*((1+p*u)/2), so it is large only when leverage sentiment and price agree and collapses toward zero on disagreement (fragile/transition state -> flat). Entries at |signal| > 0.30, exits on a 3xATR trailing stop from the best close since entry (also the initial hard stop) or a signal sign flip. Sizing risks 1.5% of equity against the ATR stop distance with a 1x-equity gross notional cap.
Verification Results
Verification failed (Layer 3 — sandbox backtest): No trades produced
Bar type used: BTCUSDT.BINANCE-4-HOUR-LAST-EXTERNAL, Bars processed: 2179
Diagnostics: should_enter() returned a side 0 times over 2149 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds.
Ensure your strategy produces trades with the given data and parameters.
Backtest Review
avg_trade_return_pct 0.322% clears the futures fee floor — not a fee-edge death
Backtest Review
Healthy trade sample (298 trades) and funding is a genuinely well-covered new information source
Backtest Review
Signal fires and matches the hypothesis direction on the long side
Backtest Review
profit_factor 1.11 is below the 1.2 meaningful-edge line; Sharpe 0.434 with sharpe_ci_low -0.15 straddles zero pre-optimization
Backtest Review
The long-SHORT premise fails: 247 long vs 51 short trades and short_win_rate 11.8% — the short leg (the whole reason for the 13.5% bucket) does not work
Backtest Review
Returns are carried by ~6 outlier days (kurtosis 19.3, skew 1.70); strip them and the edge disappears — not a persistent signal
Backtest Review
Wildly inconsistent across regimes: 2022 -24.9%, 2026 -29.8%, recent rolling Sharpe ~ -13; information_ratio -0.649
Backtest Review
Headline inflated: end_unrealized_pct 40.1 of 87.8% total_return (~46%) is un-exited open-position mark-to-market, not realized
Outcome Summary
BtcFundingRegimeTrendContinuationLS aimed to ride BTC directionally with the persistent funding-rate regime — treating sustained positive/negative funding as a leverage-sentiment signal and holding only when price agreed — as a continuation play distinct from the session's many dead funding fades. Across three iterations it produced a large 298-trade sample, but the long-short thesis collapsed under its own trades: 247 longs to 51 shorts with an 11.8% short win rate revealed a long-biased momentum rider, not a two-sided edge. The risk-adjusted profile was thin and fragile — profit factor 1.11, Sharpe CI straddling zero, information ratio -0.649, drawdowns near 32%, and nearly half the headline return unrealized — with profits carried by a handful of outlier bull days. The reviewer abandoned it at backtest-review rather than optimize, concluding that best-of-225 trials would only overfit those tail days before an inevitable overfit-abandon.
Outcome Summary
A long-short hypothesis must be validated by both legs actually working — a 247/51 trade split with an 11.8% short win rate means the strategy is really a long-biased momentum rider, and tail-day-dependent profits with a sub-1.2 profit factor won't survive optimization in the no-survivor momentum/continuation class.
Outcome Summary
It was abandoned at the pre-optimization BACKTEST_REVIEW gate: profit factor 1.11 sat below the 1.2 meaningful-edge line, Sharpe's CI already straddled zero, the short leg (the entire reason for the long-short bucket) didn't work, and the apparent profit rested on ~6 outlier bull days with performance wildly inconsistent across regimes (2022 -24.9%, 2026 -29.8%).
Outcome Summary
Trade the BTCUSDT.BINANCE perp long/short WITH the persistent funding-rate regime — riding long when sustained positive funding signals bull leverage and short when sustained negative funding signals bear leverage, but only when the price trend agrees.
Outcome Summary
The backtest produced 298 trades but the long-short premise broke down: 247 long vs only 51 short, with a short win rate of just 11.8%. Headline metrics were thin and tail-dependent — profit factor 1.11, Sharpe 0.434 (CI [-0.15, 1.11] straddling zero), information ratio -0.649, max drawdown 31.9%, avg per-trade return 0.322% (above the fee floor), and ~46% of the +87.8% total return was un-exited open-position mark-to-market.
Iteration History
Verification failed (Layer 2 — synthetic scenarios):
Parameters used: ['risk_frac', 'trail_atr', 'atr_period', 'regime_days', 'min_notional', 'trend_period', 'entry_threshold', 'max_notional_frac', 'max_funding_lag_hours']
Check that __init__ sets all attributes from self.parameters.get().
- steady_uptrend: TypeError: BtcFundingRegimeTrendContinuationLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735691400000)
- steady_downtrend: TypeError: BtcFundingRegimeTrendContinuationLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735691400000)
- flat_ranging: TypeError: BtcFundingRegimeTrendContinuationLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735691400000)
- volatility_spike: TypeError: BtcFundingRegimeTrendContinuationLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735691400000)
- zero_volume: TypeError: BtcFundingRegimeTrendContinuationLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735691400000)
- price_gap: TypeError: BtcFundingRegimeTrendContinuationLS._ts() takes 1 positional argument but 2 were given (bar timestamp: 1735691400000)
Backtest and paper results are hypothetical. Trading involves risk of loss.