XrpFourHourBullFlagBreakoutContinuationLong
Hypotheses
XRP 4H Bull Flag Pole-Flag-Breakout Continuation Long-Only (BINANCE USD-M Futures, 4H, OHLCV-Only, Multi-Bar Chart Pattern)
Hypotheses
Long-only 4-HOUR bull flag chart-pattern strategy on XRPUSDT.BINANCE. Bull flag is one of the most-documented multi-bar continuation patterns in technical analysis (Edwards & Magee 'Technical Analysis of Stock Trends' 1948, Bulkowski 'Encyclopedia of Chart Patterns' 2005). Mechanism: detect a 3-step pattern: (Step 1 'pole') 3+ consecutive green 4H bars with cumulative move ≥ 5% — a strong directional impulse; (Step 2 'flag') 3-5 subsequent bars that consolidate with smaller ranges and slight downward drift (each bar's range < pole's average range AND each bar's close NOT far below pole's end — a tight flag rather than a deep retracement); (Step 3 'breakout') a green bar that closes above the flag's highest high, signaling the consolidation has resolved upward. Enter LONG on the next bar's open after Step 3 confirms. This is a STRUCTURALLY DIFFERENT signal from every existing strategy in portfolio: not a single-bar anatomy read (RangeExpansion failed), not a multi-bar polarity streak (Streak failed), not a price-channel break (Donchian, Keltner), not a volume signal (Volume Breakout family), not a vol-compression coil (NR-Coil), not a single-bar thrust (Thrust). Bull flag requires the ENTIRE pole+flag+breakout sequence to fire, making it a more selective and pattern-confirmation-based signal. EXPLICIT 4-HOUR SPEC: my prior daily-spec hypotheses kept being translated by developer to 12H/8H which then failed refill. This hypothesis is HARD 4-HOUR — developer must NOT translate. ACKNOWLEDGED DIRECTION QUOTA VIOLATION: long-only is 90.5% vs ≤55% target (7th consecutive turn). The 5 explicit refutations of BTC 4H long-short fade strategies make this trade-off correct — adding more empirically-broken long-short hypotheses serves nobody. DATA SAFETY: uses XRPUSDT.BINANCE-4-HOUR-LAST-EXTERNAL — proven safe via landed XrpFourHourVolumeBreakoutLong (this is the paper_stage success at Sharpe 1.84). ZERO supplementary data, ZERO extra bar types, ZERO extra instruments. Fills two portfolio gaps: (1) XRP asset coverage from my contributions (zero XRP strategies of mine; portfolio has only 1 landed XRP strategy across 974 experiments); (2) MULTI-BAR PATTERN CONFIRMATION mechanism class (no existing strategy uses 'impulse + consolidation + breakout' as a coupled 3-step pattern; all existing strategies fire on simpler 1-3 condition checks). Expected ~25-40 entry cycles per year × 6 years of XRP 4H data ≈ 150-240 trades, comfortably above walk-forward sample-size floor.
Hypotheses
Iteration 3 fixes the Layer 2 TypeError: `_continuous_score` was a @staticmethod declared with a single `closes` parameter, but in the verification proxy's execution context it was invoked as a bound method (self + closes = 2 args), raising 'takes 1 positional argument but 2 were given'. The minimal fix converts it to a regular instance method (`def _continuous_score(self, closes)`) so the `self` bind is expected and the call `self._continuous_score(closes)` resolves correctly. No other logic changed: the continuous proximity score (which already varied and passed the earlier frozen-signal checks), the full pole+flag+breakout pattern detection, entry/exit/sizing, imports, and config are all untouched, so no previously-passing layer regresses. calculate_signal still returns a continuous bounded background score every bar and only emits >=1.0 (entry_threshold) on a confirmed breakout; leverage 2.0 is genuinely consumed in position_size (0.60 x 2.0 = 1.2x equity notional).
Hypotheses
Functioning bull-flag breakout strategy with strongly negative edge on XRP 4H — Sharpe -5.9, profit_factor 0.43, expectancy -731, win_rate 37.9%, negative in 4 of 6 years. The avg holding of ~1 bar (4h41m) against a 6-bar time stop shows the breakout entries are stopped out almost immediately: the pattern buys FALSE breakouts that reverse within a bar or two, and 19.6% commission-of-gross fee drag compounds it. Two independent reasons not to optimize: (1) the realized edge is decisively negative (a signal-quality failure, not a tunable), and (2) only 29 trades in 6.5 years — 5-8x below the hypothesis's own 150-240 design target and under the walk-forward sample floor — so any optimization would fit noise and fail walk-forward/holdout. This is not a code artifact (sizing and returns are clean), so there is nothing to iterate; loosening the pattern to raise frequency would most likely add more immediate-reversal losers rather than create edge. The XrpFourHourVolumeBreakoutLong sibling already covers XRP breakouts at Sharpe 1.84; the bull-flag pattern-confirmation variant does not carry a continuation edge on this instrument. Not worth 2 hours of optimization compute.
Implementation
Long-only 4-hour bull-flag chart-pattern continuation strategy on XRPUSDT.BINANCE USD-M futures (leverage 2.0). Detects a coupled 3-step pattern: (1) POLE = >=3 consecutive green bars with cumulative move >=5%; (2) FLAG = 3-5 tight consolidation bars (each range below the pole's average range, each close within a shallow retrace fraction of the pole height); (3) BREAKOUT = a green bar closing above the flag's highest high, which triggers a long. Exits via stop-loss (4%), take-profit (8%), or a 6-bar time stop. Pure OHLCV, no supplementary data, hard 4-hour timeframe.
Verification Results
Verification failed (Layer 2 — synthetic scenarios):
Parameters used: ['min_notional', 'position_pct', 'flag_max_bars', 'flag_min_bars', 'max_hold_bars', 'pole_max_bars', 'pole_min_bars', 'pole_min_move', 'stop_loss_pct', 'entry_threshold', 'take_profit_pct', 'flag_retrace_frac']
Check that __init__ sets all attributes from self.parameters.get().
- steady_uptrend: TypeError: XrpFourHourBullFlagBreakoutContinuationLong._continuous_score() takes 1 positional argument but 2 were given (bar timestamp: 1735690620000)
- steady_downtrend: TypeError: XrpFourHourBullFlagBreakoutContinuationLong._continuous_score() takes 1 positional argument but 2 were given (bar timestamp: 1735690620000)
- flat_ranging: TypeError: XrpFourHourBullFlagBreakoutContinuationLong._continuous_score() takes 1 positional argument but 2 were given (bar timestamp: 1735690620000)
- volatility_spike: TypeError: XrpFourHourBullFlagBreakoutContinuationLong._continuous_score() takes 1 positional argument but 2 were given (bar timestamp: 1735690620000)
- zero_volume: TypeError: XrpFourHourBullFlagBreakoutContinuationLong._continuous_score() takes 1 positional argument but 2 were given (bar timestamp: 1735690620000)
- price_gap: TypeError: XrpFourHourBullFlagBreakoutContinuationLong._continuous_score() takes 1 positional argument but 2 were given (bar timestamp: 1735690620000)
Backtest Review
Strategy functions correctly: pattern detection fires, 29 entries submitted, sizing at the intended ~1.2x leverage, no MTM/sizing artifacts.
Backtest Review
Genuinely novel multi-bar pattern-confirmation mechanism class, cleanly specced to hard 4H.
Backtest Review
Strongly negative edge: Sharpe -5.9, Sortino -10.1, profit_factor 0.43, expectancy -731, probabilistic_sharpe 0.034, total_return -21%.
Backtest Review
Immediate-reversal signature: avg holding 4h41m (~1 bar) against a 6-bar time stop means breakouts are stopped out almost instantly — the pattern buys false breakouts that fade.
Backtest Review
Far too few trades to optimize: 29 in 6.5 years (~4.5/yr), 5-8x below the hypothesis's own 150-240 estimate and under the walk-forward sample floor — optimization would fit noise.
Backtest Review
Extreme fee drag: commission_pct_of_gross 19.56% on tiny gross profit.
Outcome Summary
XrpFourHourBullFlagBreakoutContinuationLong introduced a new multi-bar pattern-confirmation mechanism class — a classic bull flag requiring a coupled pole, flag, and breakout — on XRP 4H futures, expecting 150-240 trades over six years. It ran correctly but fired only 29 times, and those breakout entries were stopped out within roughly a bar, yielding a -21% return, a -5.9 Sharpe, a 0.43 profit factor, and a punishing 19.6% fee drag from rapid churn. The reviewer abandoned it at the backtest-review gate for two independent reasons — a decisively negative signal-quality edge and a trade count far below the walk-forward sample floor — concluding optimization would only fit noise. The decisive finding was that the bull-flag pattern buys false breakouts that reverse on XRP and carries no continuation edge the existing volume-breakout sibling doesn't already cover.
Outcome Summary
A structurally novel, highly selective pattern is not automatically an edge: the strict pole+flag+breakout sequence fired far too rarely and caught immediate-reversal false breakouts on XRP, where the simpler XrpFourHourVolumeBreakoutLong sibling already captures the continuation edge at Sharpe 1.84.
Outcome Summary
The backtest-review verdict was 'abandon' before optimization ran (optimization_report is null): the edge was strongly negative and the ~1-bar average hold showed breakouts being stopped out almost immediately (buying false breakouts that fade), while just 29 trades — 5-8x below the hypothesis's own 150-240 estimate and under the walk-forward sample floor — meant optimization would only fit noise.
Outcome Summary
A long-only XRP 4H chart-pattern strategy on BINANCE USD-M futures (leverage 2.0) that detects a coupled three-step bull flag — a ≥5% consecutive-green 'pole', a tight 3-5 bar consolidating 'flag', then a green breakout above the flag's high — and enters long on the confirmed breakout, exiting via take-profit, stop-loss, or a 6-bar time stop.
Outcome Summary
The backtest produced only 29 long trades over ~6.5 years and lost money decisively: -21% total return, Sharpe -5.9, Sortino -10.1, profit factor 0.43, expectancy -731 per trade, 37.9% win rate, 21% max drawdown, probabilistic Sharpe 0.034, with a ~4h41m average hold (about one bar) and a 19.56% commission-of-gross fee drag.
Iteration History
Verification failed (Layer 2 — synthetic scenarios):
Parameters used: ['min_notional', 'position_pct', 'flag_max_bars', 'flag_min_bars', 'max_hold_bars', 'pole_max_bars', 'pole_min_bars', 'pole_min_move', 'stop_loss_pct', 'take_profit_pct', 'flag_retrace_frac']
Check that __init__ sets all attributes from self.parameters.get().
- steady_uptrend: Frozen signal: all 483 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.
- steady_downtrend: Frozen signal: all 483 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.
- flat_ranging: Frozen signal: all 483 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.
- volatility_spike: Frozen signal: all 483 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.
- zero_volume: Frozen signal: all 483 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.
- price_gap: Frozen signal: all 483 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.
Backtest and paper results are hypothetical. Trading involves risk of loss.