Skip to content

View translation

BnbBollingerReversionRangingGatedLS

Hypotheses

BNB USD-M Intraday Bollinger Mean-Reversion, Long-Short, Ranging-Regime Gated (BINANCE Perp, 15m Bars, Fade 2σ Band Excursions Back to the Mean ONLY When ADX Shows No Trend, Single-Instrument, Pure OHLCV, 4-Parameter)

Hypotheses

A LONG-SHORT, single-instrument intraday mean-reversion strategy on BNBUSDT.BINANCE (USD-M perpetual, 15-minute bars). It is built directly from this session's accumulated evidence about what actually clears the pipeline with a CLEAN, diagnosable backtest: (a) the ONE long-short mechanism that reached paper is single-instrument intraday VWAP/mean-reversion (SOL) — whereas every multi-asset perp basket I proposed died on non-diagnostic backtest artifacts (implausible 445% vol / Sharpe>5) or >50% drawdowns, and every two-leg perp construction died on implausible-return risk_reject. So this stays deliberately SINGLE-INSTRUMENT (clean P&L accounting, no leg-sizing or basket-aggregation artifacts). Its distinguishing improvement over the marginal ungated VWAP survivors is a RANGING-REGIME GATE: it fades band excursions ONLY when ADX indicates no trend, directly addressing mean-reversion's core failure mode (getting run over on trend days). BNB is chosen because it is deeply liquid yet structurally more range-bound / less momentum-driven than high-beta alts, so intraday reversion is cleaner and trend-day stop clusters are rarer. Pure OHLCV (best-surviving tag), standard BINANCE USD-M linear venue (no COIN-M mismatch risk), and only 4 parameters — deliberately few to avoid both overfit (202x killer) and the Layer-2 'too many __init__ attributes' failure that sank my 10-parameter taker-flow attempt. Fills the two most under-represented survivable buckets: DIRECTION (long_short, 15.2% vs ≤55% long-only cap) and HORIZON (short, 5.2% vs ≥10%).

Hypotheses

Iteration 3 fixes the twice-repeated Layer-4 economic block (L6) with the two mechanism-level changes the reviewer's own diagnosis points to, while changing NO code logic (only the config bar_type and two parameter defaults) so all credited work is preserved. Root cause per QA: '15m turnover couldn't clear the 0.10% RT fee' (commission ~31% of gross) and negative expectancy from avg_win 80 << avg_loss 201 (winners cut at exit_z=0.5 while losers ran). Fix 1 raises the HORIZON 15m -> 1H: per-trade reversion moves grow ~2x and turnover drops ~4x, so the fixed 0.10% RT fee falls from ~31% of gross to a small single-digit fraction of a winning trade's gross (verified arithmetically: ~3% of win). Fix 2 sets exit_z 0.5 -> 0.0 to target the FULL mean, so a winner captures the entire ~bb_std (~2.5 sigma) excursion while the proportional z-stop caps losses near ~1 sigma, giving ~2.5:1 reward:risk and positive expectancy that flips the avg_win/avg_loss asymmetry. Everything the reviewer credited is untouched: the O(1) incremental Bollinger (running sums + fsum resync) and Wilder ADX (no Layer-3 timeout), the ADX ranging gate, the hard price stop-loss (liquidation preventer), the lower risk_frac 0.20, and the off-by-one entry-bar fix; imports stay clean (collections.deque stdlib, no numpy, no banned imports). It remains single-instrument (clean P&L, no basket/leg artifacts), pure OHLCV, BINANCE USD-M linear, symmetric long/short, preserving the DIRECTION bucket goal. The horizon is moved up only because the reviewer's repeated, explicit finding is that 15m cannot clear fees for this mechanism — a viable clean backtest on 1H is worth more than nominally hitting the short-horizon bucket with a strategy that is abandoned for negative edge; calculate_signal still returns the raw bar-varying z-score and the entry stays thresholded and ADX-gated in should_enter.

Hypotheses

Decisively negative-expectancy single-name mean-reversion — no edge to optimize. Over 827 measured trades: profit_factor 0.675 (<1), avg_trade_return_pct -0.186% (negative), expectancy -$54.6/trade, total_return -46.6% over 6.5 years, Sharpe -0.35 with CI [-1.19, 0.42] (PSR 0.27), losing in 6 of 7 years (2021 -19.4%, 2020 -13.8%, 2022 -10.7%). The iteration-3 'target the full mean' (exit_z=0) change did not fix the reward:risk: win_rate is 58% but avg_win $195 < avg_loss $401 (~0.5), so the hard stop/z-stop keep cutting losers at larger notional than winners capture (≈ -$55/trade), and the ADX ranging gate does not rescue it. It is fee-fragile (commission 12.3% of gross), high-drawdown (48.2%, CI to 81%), and the stressed regime is -35% (Sharpe -1.33). This is the L55 single-name fade/reversion family (0/174 survivors), where re-tuning entry/exit/gate levers has never lifted the class over costs, and iterations 2-3 already spent on exactly those. No parameter change flips a sub-0.7-PF, negative-per-trade, RR-inverted reversion that loses every year. Failure pattern: no_edge/fee_edge single-name mean-reversion, RR-inverted (L55).

Implementation

Long/short Bollinger mean-reversion on BNBUSDT.BINANCE USD-M perp, now 1-HOUR bars, pure OHLCV. It fades band excursions (z = (close-SMA)/std >= +bb_std goes short, <= -bb_std goes long) but ONLY in a ranging regime (Wilder ADX(14) < adx_threshold), since trend days are mean-reversion's failure mode. Positions take profit on full reversion to the mean (|z| <= exit_z = 0.0), and cut on a z-blowout beyond +/-stop_z, a hard percentage stop-loss, or a max-hold time stop. Single instrument, symmetric long/short, no leverage. Bollinger stats and ADX are computed incrementally (O(1) per bar). 4 tuned parameters: bb_period, bb_std, adx_period, adx_threshold.

Verification Results

CLEAN RESTART 2026-09-04 — this run's verdict history and learning records were removed and it was restarted from verification. Its previous abandonment came from the pipeline, not from the market: the Layer-2 harness mis-bound @staticmethod helpers (fixed), QA issued terminal performance verdicts on an unoptimized smoke test (removed — QA now judges correctness only), and sandbox timeouts came from backtest-slot starvation (fixed). The hypothesis and the strategy code are unchanged. Verify the code on its merits; performance is decided later by the full backtest and the optimizer.

Backtest Review

Well-measured (827 trades over 6.5 years); clean 4-parameter pure-OHLCV construction with an ADX regime gate; no liquidation

Backtest Review

Incremental Bollinger/Wilder-ADX (Layer-3 timeout fixed); correct linear USD-M sizing

Backtest Review

Negative expectancy: PF 0.675, avg_trade_return_pct -0.186%, expectancy -$54.6/trade, total_return -46.6%, Sharpe -0.35 (CI [-1.19, 0.42])

Backtest Review

Loses in 6 of 7 years (2021 -19.4%, 2020 -13.8%, 2022 -10.7%); RR inverted (avg_win $195 < avg_loss $401) despite the iteration-3 exit_z=0 'full mean' fix

Backtest Review

Fee-fragile (commission 12.3% of gross); high drawdown (48.2%, CI to 81%); stressed regime -35% (Sharpe -1.33)

Backtest Review

L55 single-name fade/reversion family (0/174 survivors); iterations 2-3 already spent on exactly these exit/gate levers

Iteration History

Verification failed (Layer 4 — QA review): - FEE-VIABILITY/EDGE FAILURE + liquidation; the ADX ranging gate did NOT prevent it. Reliable sandbox (2269 days, 6277 trades): total_return -100%, liquidated 2021-01-23, avg_trade_return_pct -0.0226% (<< 0.15% floor), commission 31.82% of gross (nearly a third). NOT an L17 bug — win_rate 0.613, PF 0.469, skew -9.79 are a coherent mean-reversion payoff, and polarity/exits/gate/sizing are correct. L6 pattern: 15m turnover can't clear the 0.10% RT fee, worsened by fading BNB's 2021 parabola at aggressive risk_frac 0.40 → liquidation. Per L6/checklist #7, block at Layer 4. - Minor off-by-one time stop (fires at max_hold_bars+1, same as AVAX sibling). Immaterial. - CREDIT: code and indicators correct. Incremental O(1) Bollinger + Wilder ADX are sound and fixed the Layer-3 timeout; ADX gate correctly wired (fades only when ADX<threshold). Block is purely economics.

Iteration History

Verification failed (Layer 4 — QA review): - FEE/EDGE FAILURE PERSISTS. Reliable sandbox: total_return -100%, liquidated 2025-06-17, avg_trade_return_pct -0.0033% (still negative), commission 30.91% of gross (barely down from iter-1's 31.82% — wider band cut trades 6277→3207 but shrank gross too). avg_win 80 < avg_loss 201 → negative expectancy. Hard stop averted the 2021 blowup (liq moved to 2025) but created no positive edge. L6 pattern, not L17 bug (win 0.591/PF 0.576 coherent). Block per L6/checklist #7. - avg_position_pct 377% (despite risk_frac 0.20 → ~20% notional), kurtosis 239.5 are near-zero-equity terminal-liquidation artifacts, not a sizing bug (position_size correctly computes 20% notional). Artifact-free facts: -100%, liquidated, avg_trade -0.0033%, commission 30.91%. - CREDIT: iter-2 changes correctly implemented (wider bands, hard stop, lower risk_frac, off-by-one fix, correct ADX gate, sound O(1) Bollinger + Wilder ADX, no timeout). Block is purely economics.

Iteration History

Verification failed (Layer 4 — QA review): - NEGATIVE EDGE on a now-CLEAN backtest. The 1H move fixed fees/liquidation/metrics, and the trustworthy result proves no edge: total_return -45.79%, Sharpe -2.40 (CI entirely <0), PF 0.669, avg_trade_return_pct -0.185%. exit_z=0.0 did NOT fix the asymmetry (avg_win 197 << avg_loss 405 → expectancy -57/trade). Fees now only 12.25% of gross, so it's NEGATIVE edge BEFORE fees (~-0.085% gross/trade), not fee drag. Not an L17 bug (coherent win 0.579/PF 0.669/no liquidation), code correct — a definitive edge failure. Per L6/checklist #7, block. - CREDIT: iter-3 changes correct and delivered the diagnostic cleanliness requested. 1H + exit_z=0.0 are the only changes; ADX gate/stops/incremental indicators unchanged and correct. FIRST clean backtest of this strategy: no liquidation, coherent metrics (vol 9.40%, data_days 761 consistent, skew -0.57), fees 12.25%. Block is purely that the trustworthy result reveals negative edge, not any defect.
Strategy report

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