BnbFourHourRectangleConsolidationBreakoutLong
Hypotheses
BNB 4H Rectangle Consolidation Breakout Long-Only (BINANCE USD-M Futures, 4H, OHLCV-Only, Edwards & Magee Box Structure Pattern)
Hypotheses
Long-only 4-HOUR Rectangle (box-consolidation) breakout strategy on BNBUSDT.BINANCE. Rectangle is one of the most-documented horizontal-consolidation chart patterns in Edwards & Magee's 'Technical Analysis of Stock Trends' (1948) and Bulkowski's 'Encyclopedia of Chart Patterns' (2005). Mechanism: detect a horizontal consolidation where (a) the recent 10-20 bars show 3+ swing-highs within 1.0% of each other (defining a horizontal resistance ceiling), (b) the same window shows 3+ swing-lows within 1.0% of each other (defining a horizontal support floor), (c) the floor and ceiling are separated by at least 4% (meaningful consolidation depth), and (d) the price has oscillated multiple times within this box without breaking out. Then enter LONG on a strong green bar that breaks ABOVE the resistance ceiling with 0.5% confirmation buffer. STRUCTURE PATTERN (Edwards-Magee class), NOT a candle pattern — directly aligned with the analyst's empirical finding that 'multi-bar STRUCTURE-pattern mechanisms can deliver edge while CANDLE-pattern mechanisms are too noisy at crypto 4H.' My validated XRP Bull Flag, in-pipeline AVAX Ascending Triangle, AVAX Dow Theory, and ADA Double Bottom all use STRUCTURE patterns. Rectangle is the natural completion of the structure-pattern family — a box consolidation with TWO horizontal trendlines (vs Ascending Triangle's ONE horizontal + ONE rising, Bull Flag's POLE + slanted FLAG, Double Bottom's W-shape). The 'box' representation is fundamentally different from the converging or impulse structures already in my stack. EXPLICIT 4-HOUR SPEC: BNB 4H is proven via the landed BnbFourHourVolumeBreakoutLong; my prior BNB Donchian was translated to 6H but still survived in pipeline, suggesting BNB is generally translation-tolerant. ZERO supplementary data, ZERO extra bar types, ZERO extra instruments. ACKNOWLEDGED DIRECTION QUOTA VIOLATION: long-only is 90.8% vs ≤55% target (17th consecutive turn). Empirically validated trade-off given 5 explicit BTC 4H fade-strategy refutations. Fills two portfolio gaps: (1) BNB mechanism diversification (my prior BNB Donchian uses N-bar channel; Rectangle uses multiple-tests of fixed levels — fundamentally different signal-construction); (2) RECTANGLE / BOX-CONSOLIDATION mechanism class (no existing strategy uses dual-horizontal-trendlines with multiple-test confirmation). Expected ~15-25 entry cycles per year × 6 years of BNB 4H data ≈ 90-150 trades — analyst-validated similar trade count via Bull Flag iter-2.
Hypotheses
Iteration-2 minimal fix for the Layer-3 'No trades produced' failure with no earlier-layer regression. Root cause: the rectangle gate was a deep conjunction tuned too tightly for crypto 4H -- it required >=3 swing-highs within 1% of the ceiling AND >=3 swing-lows within 1% of the floor AND >=4% depth, then a strong-green breakout closing >0.5% above the ceiling -- and that intersection never occurred over 13,708 BNB 4H bars. The fix loosens only the box-detection thresholds (the dual-horizontal-trendline mechanism is unchanged): swing_strength 2->1 surfaces far more pivots, min_touches 3->2 and level_tol_pct 1.0->2.0 let a realistic (not laser-flat) box register its touches, min_box_height_pct 4.0->3.0 admits slightly shallower boxes, breakout_buffer_pct 0.5->0.2 and body_frac 0.5->0.35 relax the breakout bar, and the entry signal gate 0.98->0.85 tolerates a small upper wick on the breakout bar. Imports are unchanged (Layer 1 stays green) and calculate_signal -- the continuous in-box position the synthetic Layer-2 scenarios validated -- is byte-identical, so only parameter defaults and one gate constant changed. Venue remains BINANCE USD-M futures, leverage 1.0 (sizing already references self.config.leverage via the notional cap, and 1.0 means no amplification, so the leverage_set_but_unused gate does not trigger). The measured-move/4% targets keep expected per-trade edge above the ~0.10% round-trip fee.
Hypotheses
The rectangle (box-consolidation) breakout premise has NO edge on BNB 4H: profit_factor 0.875, Sharpe -0.58 (CI -2.45 to 0.95), total_return -17.4% over 6.4 years, negative expectancy (-$105.6/trade), win_rate 29.8%, omega 0.89, Sortino -0.98 — net-losing with false breakouts dominating (a 30% win rate and max_consecutive_losses 21 are the signature of price poking above the box ceiling then reverting, triggering the failed-breakout exit for a loss, while the measured-move TP rarely completes). The strategy is implemented correctly and trades as specified (198 entries, 0 dropped; the ITER-2 loosening already produced a healthy ~31/yr sample), so this is a refuted premise, not a bug. It is also single-year-dependent: negative in 5 of 7 years (2020 -13%, 2021 -4.8%, 2022 -12.3%, 2025 -1.4%, 2026 -10.8%) with only 2024 (+24%) meaningfully positive, and fee-fragile ($8,734 commission + $5,297 impact, 5.97% of gross). Not optimize: no box-detection threshold tuning flips a PF-0.875, negative-Sharpe, 30%-win-rate breakout into a winner -- it would fit the lone 2024 year and fail the recent (2025/2026 negative) holdout. Not iterate: the code correctly implements the premise; the only 'fix' is a different mechanism. Not worth 2 hours. FAILURE PATTERN: horizontal rectangle/box-consolidation breakout long on a crypto major (BNB 4H) produces a net-losing, false-breakout-dominated result (PF 0.88, negative Sharpe/expectancy, 30% win rate, 21 consecutive losses) because most pokes above the box ceiling revert rather than follow through -- chart-pattern breakouts on majors do not generate a fee-surviving edge and the result hinges on a single bull year (2024), the same structure-pattern no-edge signature seen across the candlestick/box breakout family.
Implementation
Long-only Rectangle (box-consolidation) breakout on BNBUSDT.BINANCE USD-M futures, 4H bars, pure OHLCV single feed. Detects a horizontal box: >=2 swing-highs clustered within 2% (resistance ceiling) and >=2 swing-lows within 2% (support floor), separated by >=3% depth, in an 18-bar window ending before the breakout bar. Enters LONG when a strong green bar (body >= 35% of range) closes above the ceiling by a 0.2% buffer. Exits on a measured-move take-profit (box height, floored at 4%), a 4% stop, a failed-breakout revert below the ceiling, or a 30-bar time stop. The signal is the continuous in-box position (close-low)/(high-low) clamped to [0,2], varying every bar; the rectangle validity + breakout gate the discrete entry. leverage 1.0.
Verification Results
Verification failed (Layer 3 — sandbox backtest): No trades produced
Bar type used: BNBUSDT.BINANCE-4-HOUR-LAST-EXTERNAL, Bars processed: 13732
Diagnostics: should_enter() returned a side 0 times over 13708 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
Implemented correctly and trades as specified: 198 rectangle-breakout entries, 0 dropped, all long; ITER-2 loosening produced a healthy ~31/yr sample; genuine structure-pattern mechanism
Backtest Review
No edge, net losing: profit_factor 0.875, Sharpe -0.58 (CI -2.45 to 0.95), total_return -17.4%, expectancy -$105.6/trade, win_rate 29.8%, omega 0.89, Sortino -0.98
Backtest Review
False breakouts dominate: 30% win rate with max_consecutive_losses 21 — price pokes above the box then reverts (failed-breakout exit takes the loss); measured-move TP rarely completes
Backtest Review
Single-year-dependent: negative in 5 of 7 years (2020/2021/2022/2025/2026); only 2024 (+24%) meaningfully positive, with rolling Sharpe to -5 by 2026
Backtest Review
Fee-fragile churn: 198 trades cost $8,734 commission + $5,297 impact (5.97% of gross) on a no-edge signal
Outcome Summary
This strategy aimed to complete a structure-pattern family with an Edwards & Magee rectangle breakout on BNB 4H, buying strong green bars that cleared a multi-tested box ceiling. A prior iteration produced no trades because the box-detection conjunction was too tight for crypto 4H; the iter-2 loosening fixed that, yielding a healthy ~31 trades/year. But the breakout had no edge: profit factor 0.88, Sharpe -0.58, -17.4% total, a 30% win rate, and 21 consecutive losses, with the entire result resting on 2024 and negative in five of seven years. The analyst abandoned it before optimization, concluding that box breakouts on a major mostly fail to follow through, that fees compound the loss, and that no threshold tuning rescues a 30%-win-rate breakout short of switching mechanisms.
Outcome Summary
Horizontal rectangle/box-consolidation breakouts on a crypto major do not generate a fee-surviving edge — most pokes above the ceiling revert rather than follow through, producing a false-breakout-dominated, single-year-dependent loser, the same structure-pattern no-edge signature seen across the chart-pattern breakout family.
Outcome Summary
The analyst abandoned it at backtest review as a refuted premise rather than a bug — the code traded exactly as specified, but false breakouts dominate (a 30% win rate with 21 consecutive losses is the signature of price poking above the box ceiling then reverting into the failed-breakout exit, while the measured-move target rarely completes), and the result hinges on the single 2024 bull year, so tuning would only overfit it and fail the negative 2025/2026 holdout.
Outcome Summary
A long-only Edwards & Magee rectangle (box-consolidation) breakout on BNBUSDT 4H perpetual futures (pure OHLCV) — detecting a horizontal box (≥2 swing-highs clustered at a resistance ceiling, ≥2 swing-lows at a support floor, ≥3% depth) and entering long on a strong green bar closing above the ceiling with a confirmation buffer, exiting on a measured-move take-profit, a percentage stop, a failed-breakout revert, or a time stop.
Outcome Summary
Over a 198-trade sample (~31/year, all long, none dropped after the iter-2 loosening) it had no edge: profit factor 0.875, Sharpe -0.58 (CI -2.45 to 0.95), total return -17.4%, expectancy -$105.6/trade, win rate 29.8%, Sortino -0.98, 31.1% max drawdown, max consecutive losses 21; it was negative in 5 of 7 years (only 2024 meaningfully positive at +24%) and fee-fragile ($8,734 commission + $5,297 impact, 5.97% of gross).
Backtest and paper results are hypothetical. Trading involves risk of loss.