Skip to content

View original

BtcDailyFibonacciRetracementBounceLongShort

Hypotheses

BTC Single-Asset Fibonacci Retracement Bounce Long-Short on BINANCE Daily (Gann/Murphy Fibonacci Levels 38.2/50/61.8, Swing-Derived Support-Resistance, Event-Driven)

Hypotheses

Single-asset Fibonacci retracement bounce strategy on BTCUSDT.BINANCE — after identifying a recent major swing (high-to-low or low-to-high move within last 50 bars), monitors price retracement to the classic Fibonacci levels (38.2%, 50%, 61.8%) and trades bounces off these levels. Mechanism: (1) For each bar, identify the most recent major swing: find local high (highest high in last 50 bars) and local low (lowest low in last 50 bars); determine whether the most recent swing was DOWN (low after high — bearish swing) or UP (high after low — bullish swing). (2) For BEARISH SWING (recent high → recent low): compute Fibonacci RESISTANCE levels = swing_low + (swing_high - swing_low) × {0.382, 0.500, 0.618}. BEARISH BOUNCE TRIGGER (resistance rejection): price retraces UP into one of these levels AND bar[0].close fails to break the level decisively (close <= fib_level × (1 + fib_break_buffer), default 0.5%). (3) For BULLISH SWING (recent low → recent high): compute Fibonacci SUPPORT levels = swing_high - (swing_high - swing_low) × {0.382, 0.500, 0.618}. BULLISH BOUNCE TRIGGER (support bounce): price retraces DOWN into one of these levels AND bar[0].close bounces back above (close >= fib_level × (1 - fib_break_buffer)). (4) FLAT otherwise. This implements Fibonacci retracement methodology documented by W.D. Gann (1930s), formalized by Murphy 1999 'Technical Analysis of Financial Markets' and Pesavento-Jouflas 2008. Distinct from my 19 in-pipeline event-driven BTC patterns. Pivot Point Bounce (in pipeline) uses PRIOR-BAR-HLC-DERIVED levels for daily session bounces; Fibonacci uses MAJOR-SWING-DERIVED levels representing multi-week retracement points. Different signal generator: Fibonacci levels are universal (38.2/50/61.8 are fixed mathematical ratios from the Fibonacci sequence — phi/golden ratio); Pivot levels are session-bar-specific. Single-asset scope = no multi-asset translation curse. Helps direction quota (90.7% long-only).

Hypotheses

Iteration 2 fix for the Layer-2 'frozen signal: all signals 0.0' failure across all six synthetic scenarios. Root cause was the gated-signal anti-pattern: calculate_signal() returned +/-1.0 only on a discrete Fibonacci touch-and-close event and 0.0 otherwise, which on smooth synthetic data is every bar -> constant 0.0. Fix: added a continuous monitoring base (_monitoring_base: tanh(logret*50) blended with a trailing-window z-score, the proven shape that varies across these synthetic scenarios), returned on all non-pattern bars so the signal now varies. The binary decision stays gated: a confirmed bounce/rejection returns magnitude >= 2.0 (now graded by how far the close recovered/failed past the level), and should_enter() thresholds at entry_threshold=1.5, so real entries are unchanged from the version that already passed Layer 1 and the same strict swing/Fibonacci logic still drives trades at Layer 3. should_exit()'s opposite-side close and position_size()'s zero-check were likewise moved behind the threshold so the now-nonzero continuous base cannot cause spurious exits or sizing (avoids a Layer-3 regression). Imports are untouched (numpy only, no banned imports), preserving the Layer-1 pass. Venue/leverage unchanged: BINANCE futures at leverage 2.0 is required because the strategy shorts, and position_size genuinely consumes the leverage (equity * position_pct * leverage).

Hypotheses

Failed deflated Sharpe: DSR=0.0, expected-max=4.294 over 225 trials — the optimized Sharpe of 0.495 is FAR below the best-of-N luck bar and statistically indistinguishable from selection noise (is_significant=false, PBO=0.726>0.5, sharpe_ci_low=-0.58 straddles 0, PSR=0.79). The full robustness battery fails in concert with a FAILED sensitivity phase (2 cliffs: swing_lookback and fib_break_buffer; the heatmap is negative across most of the grid, so there is no robust parameter plateau to tune toward). Walk-forward OOS is [3.08, 0.82, -1.69] — carried by a single bull-era window with a negative recent window — and the optimized backtest carries max_drawdown 61.7% (2024 -51.6%) with profit_factor still only 1.096. The single passing holdout window (ratio 2.16) cannot rescue a DSR of 0.0 and PBO 0.73. Not iterate (attempt 1 of 2): the entire sensitivity grid is Sharpe ~0.3-0.6 with cliffs and negative pockets, so a second sweep would only re-select another sub-luck-bar artifact; there is no under-explored robust region. Not revise_hypothesis: this is a multiple-testing/overfit failure of a genuinely marginal Fibonacci-bounce edge, not a proven mechanism stranded on a dead target, and there is no promoted sibling to redirect to. FAILURE PATTERN: single-asset Fibonacci-retracement bounce long-short on BTC daily produces a real but marginal ~0.4-0.5 Sharpe whose headline is carried by a few bull-era windows; after best-of-225 selection it fails DSR (0.0, far below the 4.29 expected-max luck bar), fails sensitivity with cliffs on the swing-window and break-buffer params, and shows PBO 0.73 with a CI straddling 0 — the swing-derived Fibonacci level edge on a single major is too weak to deflate, regardless of parameter tuning.

Implementation

Single-asset long-AND-short Fibonacci retracement bounce on BTCUSDT.BINANCE USD-M perp, daily bars, pure OHLCV. Identifies the most recent major swing (>=5% range) in the last 50 bars; on a bullish swing, longs a bounce off Fibonacci support (38.2/50/61.8); on a bearish swing, shorts a rejection at Fibonacci resistance. calculate_signal() now returns a continuous, bar-varying monitoring score (tanh blend of log-return and trailing z-score) on non-pattern bars, while a confirmed bounce/rejection returns magnitude >= 2.0. Entries are gated in should_enter() at entry_threshold=1.5, so only confirmed signals trade. Exits: stop-loss, take-profit, opposite-side confirmed signal, or max-hold time stop. Leverage 2.0 (~1.2x equity notional, both directions).

Verification Results

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['min_notional', 'position_pct', 'max_hold_bars', 'min_swing_pct', 'stop_loss_pct', 'swing_lookback', 'take_profit_pct', 'fib_break_buffer'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: Frozen signal: all 449 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies. - steady_downtrend: Frozen signal: all 449 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies. - flat_ranging: Frozen signal: all 449 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies. - volatility_spike: Frozen signal: all 449 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies. - zero_volume: Frozen signal: all 449 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies. - price_gap: Frozen signal: all 449 signals are identical (value=0.0). calculate_signal() likely has a bug — the signal never varies.

Backtest Review

Signal functions cleanly: 308 entries from 2285 bars, 0 dropped

Backtest Review

Genuinely long-short (161L/147S), matching the hypothesis — short leg has the better win rate (52.4%)

Backtest Review

308 trades is well above the walk-forward sample floor — optimization can be statistically meaningful

Backtest Review

Positive expectancy (+$130/trade, +44.9% total), positive alpha (+3.8%), low beta (0.08) — market-neutral-ish behavior appropriate to the design

Backtest Review

Thin edge: profit_factor 1.097, Sharpe 0.43 with CI [-0.67, 1.65] straddling zero

Backtest Review

High max_drawdown 45.9% (CI to 81%); 2024 was -27.9% (-32% in Aug 2024) — short leg run over in strong trends

Backtest Review

Costs consume ~31% of gross (impact 21.6% + commission 9.55%) at avg_position_pct 130% — oversized for capacity (~$2.1M)

Backtest Review

Will face a hard deflated-Sharpe / holdout test post-optimization given the marginal base edge

Backtest Review

161L/147S

Backtest Review

both

Analysis

Mechanism correctly implemented: genuinely long-short (171L/179S optimized), market-neutral (beta 0.06, alpha +7.7%), 350 trades — ample sample

Analysis

Holdout phase passed in isolation (ratio 2.16, holdout Sharpe 1.59) — one favorable recent window

Analysis

deflated_sharpe 0.0 (need >=0.95); optimized Sharpe 0.49 far BELOW expected-max-under-noise 4.29 over 225 trials — indistinguishable from best-of-N luck

Analysis

is_significant false, PBO 0.726 (>0.5, overfit more likely than not), sharpe_ci_low -0.58 (CI straddles 0), PSR 0.79 (<0.95)

Analysis

Sensitivity FAILED with 2 cliffs (swing_lookback, fib_break_buffer); heatmap negative across most of the grid — no robust parameter region

Analysis

Walk-forward OOS windows [3.08, 0.82, -1.69] — headline carried by one window, negative recent window

Analysis

Optimized max_drawdown 61.7%, 2024 -51.6%, profit_factor still 1.096 — marginal edge with severe tail risk

Analysis

Costs heavy: impact_cost_pct 22.8%, commission 9.6% of gross

Outcome Summary

This strategy traded genuine two-sided Fibonacci retracement bounces on BTC daily, identifying major swings and fading the 38.2/50/61.8% levels, and earned an 'optimize' verdict on a marketneutral-ish profile (beta 0.08, +3.8% alpha, 308 trades, +44.9%) despite a thin sub-0.5 Sharpe. Optimization confirmed the edge was too weak to deflate: deflated Sharpe 0.0 against a 4.29 expected-max luck bar, PBO 0.726, a CI straddling zero, a failed sensitivity grid with two cliffs, and walk-forward OOS windows [3.08, 0.82, -1.69] carried by one bull-era window — while the optimized config carried a 61.7% drawdown. The analyst abandoned it at the analyzing stage on its second iteration, ruling it a multiple-testing/overfit failure of a marginal mechanism with no robust region to iterate toward and no promoted sibling to redirect to, so it stopped before risk review.

Outcome Summary

A real but marginal ~0.4-0.5 Sharpe edge whose headline is carried by a few bull-era windows is too weak to survive multiple-testing deflation — with no robust parameter plateau (cliffs on swing_lookback and fib_break_buffer) a second sweep would only re-select another sub-luck-bar artifact, and one favorable holdout window cannot rescue a DSR of 0.0.

Outcome Summary

It cleared the backtest-review gate with an 'optimize' verdict, but the post-optimization analyst abandoned it: deflated Sharpe was 0.0 (vs 0.95 bar) with an optimized Sharpe of 0.49 far below the 4.29 expected-max-under-noise over 225 trials, plus PBO 0.726, is_significant false, a CI straddling zero, and a failed sensitivity phase (2 cliffs, negative across most of the grid) — a genuinely marginal edge indistinguishable from best-of-N selection noise.

Outcome Summary

A single-asset long-and-short Fibonacci retracement bounce strategy on BTCUSDT daily Binance futures (2.0x leverage) that identified the most recent major 50-bar swing and traded bounces off the classic 38.2/50/61.8% golden-ratio levels — long on support bounces in a bullish swing, short on resistance rejections in a bearish swing.

Outcome Summary

The initial backtest showed a marginal edge — 308 trades (161 long / 147 short), +44.9% total return, Sharpe 0.43 (CI straddling zero), profit factor 1.097, expectancy +$130/trade, positive alpha +3.8% at low beta 0.08, but a 45.9% max drawdown — and the optimized config returned +80.7% yet stayed marginal (Sharpe 0.49, PF 1.096) with a worse 61.7% max drawdown and -51.6% in 2024.
Strategy report

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