Skip to content

View original

BtcFourHourIntraRangeCloseConsistencyLong

Hypotheses

BTC 4H Multi-Bar Intra-Range Close-Position Consistency Long (Stealth-Bid Structural Pattern)

Hypotheses

A long-only, single-instrument, single-timeframe strategy on BTCUSDT.BINANCE 4H bars implementing a structural intra-bar STATISTIC across multiple bars: the average position of the close within each bar's high-low range, computed over the last 5 bars. When this average is consistently in the upper third (>= 0.65) AND the current bar makes a new 5-bar high AND the long-term trend filter holds, the pattern signals 'stealth bid' accumulation — buyers systematically pushing each bar's close near its highs over multiple consecutive bars, indicating sustained buying pressure without the bars themselves making dramatic moves. Critically distinct from every existing pipeline entry: (a) NOT a Donchian breakout (uses position WITHIN bar ranges, not channel breaches on bar extremes); (b) NOT a volume-z signal (uses intra-bar close geometry, not transaction volume); (c) NOT a failed-breakdown reclaim (uses consistency of close positions, not breakout-and-reverse); (d) NOT a candlestick pattern (aggregates 5 bars statistically rather than recognizing single-bar shape); (e) NOT Williams %R (which uses multi-bar high/low extremes; this uses close position within EACH BAR's own range, averaged). The mechanism captures a regime of sustained buying interest that's invisible to channel-breakout strategies (no dramatic single-bar move required) and invisible to volume strategies (volume can be normal). Long-only because (i) sustained close-in-upper-third over multiple bars indicates bullish bias, (ii) the trend gate prevents fading downtrends, (iii) shorts on crypto majors empirically refuted. Single-instrument BTCUSDT.BINANCE 4H — confirmed-working bar type (BtcFourHourVolumeBreakoutLong + BTCFailedBreakdownReclaimLong + BTCVolumeConfirmedDonchianCalmVolLong + BTCVolumeConfirmedDonchianAntiChopLong all validate this instrument). NO secondary instruments — directly avoids the multi-instrument audit_stale failure mode.

Hypotheses

Iteration 3 addresses the sole Layer-2 blocker: 'BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given'. The TypeError's qualname (ClassName._close_position) shows the version that actually ran still had the helper attached to the class, where the verification proxy's attribute-transfer loop re-wraps every callable found in dir(instance) with types.MethodType(func, wrapper) — injecting a spurious `self` so a bar-taking helper is called as (self, bar). The definitive minimal fix is to INLINE the close-position computation (cp = (close - low)/(high - low), clamped to [0,1], 0.5 for zero-range bars) directly inside calculate_signal, so there is no separate callable for the proxy to re-bind. The arithmetic is byte-identical (verified: cp of 9 in [0,10]=0.9, flat bar=0.5, at-low=0.0, at-high=1.0), so every earlier-passing layer and all signal/entry/exit/sizing logic remain unchanged. Imports are untouched (no banned additions), and the strategy stays single-instrument single-timeframe BTCUSDT.BINANCE 4H as before.

Hypotheses

Failed deflated Sharpe and every forward gate on attempt 1. DSR=0.0611 (vs 0.95 bar) with the optimized Sharpe 3.45 BELOW the 225-trial expected-max luck bar of 6.52 (is_significant=false, sharpe_ci_low -1.28 straddling 0, PBO 0.6495 >0.5) — after multiple-testing correction the selected config is indistinguishable from best-of-N noise, and PSR 0.9588 vs DSR 0.0611 is the textbook selection-inflation trap. Decisively, the time-ordered HOLDOUT FAILED and is NEGATIVE (holdout_sharpe -2.376, ratio -5.937 vs WF-OOS 0.400) — the untouched recent window loses money — and the walk-forward is is_overfitted=true (avg IS 4.78 collapsing ~12x to avg OOS 0.40, windows [0.0, -1.78, +2.98]). Sensitivity failed with 4 cliff parameters (entry_cp, exit_cp, cp_window, trend_sma); the optimizer overfit a narrow selective region (entry_cp 0.887 -> only 29 trades / 47 effective days). Not iterate (attempt 1 of 2): the binding failure is a NEGATIVE forward holdout plus an overfit walk-forward across a cliff-ridden surface whose best-of-225 selection lands below the luck bar — there is no robust region to tune toward, so a second sweep re-selects another overfit, sub-significant config. Not revise_hypothesis: single-asset BTC 4H long-accumulation is not a proven mechanism stranded on a dead target — it is a modest, decaying long-beta edge (base Sharpe 0.316, positive only in early years) that overfits, and per the overfit->abandon rule reframing will not help. FAILURE PATTERN: a genuinely novel intra-bar close-position 'stealth-bid' statistic still fails promotion because best-of-225 selection on a 4-cliff surface overfits (IS 4.78 -> OOS 0.40, is_overfitted) to a narrow high-entry_cp region that produces a flattering full-refit Sharpe (3.45) but a NEGATIVE untouched holdout (-2.376) and DSR 0.061 far below the 6.52 luck bar. Signal novelty and a clean single-instrument data path do not rescue a modest long-beta edge that fails deflated Sharpe with a losing forward holdout; PSR 0.96/DSR 0.06 is the diagnostic tell.

Implementation

Long-only BTCUSDT.BINANCE 4H strategy trading a structural intra-bar statistic: the average position of the close within each bar's own high-low range over the last cp_window bars. Enters long when that rolling average is in the upper third (>= entry_cp) AND the current bar makes a new new_high_lookback-bar closing high AND close > SMA(trend_sma). Exits on stop-loss, take-profit, max-hold time stop, consistency fading below exit_cp, or trend breakdown.

Verification Results

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['tp_pct', 'exit_cp', 'entry_cp', 'risk_pct', 'stop_pct', 'cp_window', 'trend_sma', 'min_notional', 'notional_pct', 'max_hold_bars', 'new_high_lookback'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given (bar timestamp: 1735692660000) - steady_downtrend: TypeError: BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given (bar timestamp: 1735692660000) - flat_ranging: TypeError: BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given (bar timestamp: 1735692660000) - volatility_spike: TypeError: BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given (bar timestamp: 1735692660000) - zero_volume: TypeError: BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given (bar timestamp: 1735692660000) - price_gap: TypeError: BtcFourHourIntraRangeCloseConsistencyLong._close_position() takes 1 positional argument but 2 were given (bar timestamp: 1735692660000)

Backtest Review

335 long trades over ~6.5 years — ample sample for meaningful walk-forward optimization (not noise-fitting)

Backtest Review

Trades faithfully implement the hypothesis: all long, entering on new closing highs within the SMA-50 uptrend gate; no direction/timing contradiction

Backtest Review

Clean execution diagnostics (0 dropped for size/cash/notional), zero-range bars handled (cp=0.5 neutral), signal varies continuously

Backtest Review

Positive net-of-fee total return with commission only 7.76% of gross — not fee-dominated

Backtest Review

Weak risk-adjusted edge: Sharpe 0.316 with CI [-0.87, +1.45] straddling zero; profit_factor 1.089 is thin

Backtest Review

Negative alpha (-0.001) and information_ratio (-0.697) vs buy-hold; benchmark_correlation 0.48 — much of the return is BTC long-beta, not clean alpha

Backtest Review

Regime decay: strong early years (2020 +14.6, 2021 +6.6) fading to flat/negative recently (2022 -13.7, 2025 -0.7, 2026 -1.8) — real risk the holdout fails

Backtest Review

max_consecutive_losses 11 and impact_cost_pct 20.2% signal live-drawdown and sizing pressure

Analysis

Mechanism is faithfully implemented and genuinely distinct from existing pipeline entries (intra-bar close-position statistic); adequate base sample (335 trades)

Analysis

Clean execution (0 dropped), single-instrument single-timeframe — avoids the multi-instrument stale-leg failure mode

Analysis

Failed deflated Sharpe decisively: DSR 0.0611 vs 0.95, optimized Sharpe 3.45 BELOW the 225-trial expected-max luck bar of 6.52; is_significant false, sharpe_ci_low -1.28 straddling 0, PBO 0.6495

Analysis

Forward holdout FAILED and NEGATIVE: holdout_sharpe -2.376, ratio -5.937 vs WF-OOS 0.400 — the untouched recent window loses money

Analysis

Walk-forward is_overfitted=true: avg IS 4.78 collapses to avg OOS 0.40 (windows [0.0, -1.78, +2.98])

Analysis

Sensitivity failed with 4 cliff parameters (entry_cp, exit_cp, cp_window, trend_sma); optimized config overfit a narrow selective region (entry_cp 0.887 -> only 29 trades / 47 days)

Analysis

PSR 0.9588 vs DSR 0.0611 is the classic best-of-N selection-inflation trap; base edge is a decaying long-beta (2020 +14.6% then negative 2022/2025/2026)

Analysis

The edge is too thin to optimize productively as-is: profit_factor 1.089 with ~28% of gross PnL eaten by commissions (7.76%) + market impact (20.2%), producing negative alpha and a Sharpe CI through zero. Do NOT just re-tune existing thresholds (that is optimization's job) — the base signal must be made more selective at the LOGIC level so per-trade edge clears the cost drag. Specifically: (1) Add a volatility/ATR regime filter so entries only fire when bar ranges are meaningful — intra-bar close-position geometry is pure noise in low-range chop, where much of the 335-trade churn and impact cost comes from. (2) Require the 5-bar new-closing-high to be a genuine range expansion (e.g. current bar's range or the move above prior high exceeds a fraction of ATR), not a marginal tick above the prior close. (3) Reduce churn/impact: raise min hold or widen the exit_cp band so the strategy is not round-tripping small positions at 32% notional into a $2.46M-capacity signal. Target: materially fewer, higher-conviction entries lifting profit_factor toward >1.2 and avg per-trade return well above the ~0.10% round-trip cost before re-submitting for optimization. If a leaner version still shows PF ~1.1 and negative alpha, abandon — the intra-bar-close-consistency signal likely has no edge beyond costs on BTC 4H.

Outcome Summary

BtcFourHourIntraRangeCloseConsistencyLong introduced a genuinely novel intra-bar close-position 'stealth-bid' statistic, buying BTC 4H when buyers persistently closed each bar near its highs in an SMA-50 uptrend. It was faithfully implemented on an adequate 335-trade sample and advanced to optimize, but the edge was thin (Sharpe 0.316, CI through zero, PF 1.089) and largely decaying long-beta, positive only in the early years. Optimization confirmed the weakness: deflated Sharpe 0.061 far below the 6.52 luck bar, an overfit walk-forward (IS 4.78 → OOS 0.40), four sensitivity cliffs, and a decisively negative untouched holdout (-2.376) where the optimizer had overfit a narrow high-entry_cp region of just 29 trades. On iteration 3, attempt 1 of 2, the analyst abandoned it — concluding there was no robust region to tune toward and that a novel signal on a clean data path cannot rescue a modest edge that fails deflation with a losing forward holdout.

Outcome Summary

Signal novelty and a clean single-instrument data path do not rescue a modest, decaying long-beta edge — a best-of-225 sweep over a 4-cliff surface overfits to a narrow high-threshold region (29 trades/47 days) that yields a flattering full-refit Sharpe but a negative forward holdout, and PSR 0.96 vs DSR 0.06 is the textbook selection-inflation tell.

Outcome Summary

It cleared the backtest-review gate to optimize but the analyst abandoned it on optimization attempt 1 for failing deflated Sharpe (DSR 0.0611 vs 0.95, optimized Sharpe 3.45 below the 6.52 luck bar, PBO 0.6495, sharpe_ci_low -1.28), an overfit walk-forward (avg IS 4.78 collapsing to OOS 0.40), a negative untouched holdout (holdout_sharpe -2.376, ratio -5.937), and a sensitivity surface with 4 parameter cliffs.

Outcome Summary

A long-only BTCUSDT.BINANCE 4H 'stealth-bid' strategy using a novel intra-bar statistic — the average position of each bar's close within its own high-low range over the last 5 bars ≥ 0.65 (buyers persistently closing near highs) plus a new 5-bar closing high and a close above the 50-SMA — to detect sustained accumulation invisible to breakout and volume signals.

Outcome Summary

The base backtest took 335 long trades (0 shorts) but showed only a thin, long-beta edge: Sharpe 0.316 (sharpe_ci_low -0.866, CI through zero), profit factor 1.089, 37.6% win rate, negative alpha (-0.001) and information ratio (-0.697), total return 20.9, with clear regime decay (2020 +14.6, 2021 +6.6, then 2022 -13.7, 2025 -0.7, 2026 -1.8); the optimized refit posted Sharpe 3.45 but on just 29 trades over 47 effective days.
Strategy report

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