TrendAlignedCapitulationEntryLS
Hypotheses
Trend-Aligned Capitulation Entry — Counter-Trend Liquidation-Flush Pullback, Single-Instrument Long-Short (BTCUSDT.BINANCE USD-M — In an Established DAILY Trend, Enter ONLY on an Extreme COUNTER-Trend Forced-Liquidation Flush = Weak-Hands Capitulation; Buy the Long-Liquidation Dip in an Uptrend, Sell the Short-Squeeze Pop in a Downtrend; Ride Continuation with an ATR Trailing Stop, 3-Parameter)
Hypotheses
A LONG-SHORT, SINGLE-INSTRUMENT, SINGLE-VENUE strategy on BTCUSDT.BINANCE USD-M perpetual (~0.10% RT taker) that uses the LIQUIDATIONS feed (a Binance single-venue supplementary source confirmed present and complete for BTC in the Layer-3/Layer-4 sandbox — prior BTC liquidation strategies reached QA review on it) as the entry-timing edge on TOP of a slow directional regime. It is deliberately NOT the factory's falsified 'liquidation overshoot reversal', which faded EVERY extreme cascade UNCONDITIONALLY on 5m bars back toward the pre-cascade price and was empirically shown to have no edge (cascades continue intraday). This strategy inverts that design in two ways: (1) it only acts inside an established HIGHER-TIMEFRAME (daily) trend, and (2) it fades ONLY the COUNTER-trend flush — the forced deleveraging of weak hands positioned against the dominant trend — then targets CONTINUATION of the trend, not reversion. In a daily uptrend, an extreme LONG-liquidation flush is weak longs being shaken out into a dip; the trend's owners re-accumulate and price resumes up → BUY the flush. In a daily downtrend, an extreme SHORT-liquidation squeeze is trapped shorts being forced to cover into a pop that exhausts → SELL the pop. The liquidation feed is the orthogonal, non-price signal that pinpoints genuine forced-flow capitulation (the best risk/reward entries), while the trend filter supplies direction and keeps the strategy from catching falling knives. Multi-day holds riding the trend make per-trade moves multiple percent — far above the fee floor — and extreme counter-trend flushes are rare (a few per month), so turnover and fee drag stay low. 3 parameters resist overfit.
Hypotheses
ITERATION 3 — NO LOGIC CHANGED (QA said none was needed); the deliverable is the evidence that closes out the two remaining open questions, and my recommendation is ABANDON. QA's verdict was that the code is correct and faithful and the blocker is data availability, with the specific claim that 'no target/stop/window change adds trades the feed doesn't cover'. Rather than take that on faith or resubmit unchanged, I tested both halves of it. (1) IS THERE DEEPER HISTORY ANYWHERE? No. The PostgreSQL liquidations table — the only source src/backtesting/supp_collector.py reads for this key — holds 2,782,756 rows across 788 symbols, and EVERY symbol's min(timestamp) is 2026-04-21: that is the collector's start date, not a BTC-specific gap, so no symbol substitution or window change reaches more history. BTCUSDT now has 67,463 events over 102 days. The on-disk Vision liquidation-snapshot mirror holds only 5 delisted COIN-M dated contracts and no USDT perps, consistent with Binance having discontinued that backfill. (2) DOES LOOSENING THE GATE MAKE IT MEASURABLE? No, and it makes it worse. I swept the three axes that actually control firing rate (flush_window_hours 1/3/6 x flush_z 0.75/1.0/1.5 x atr_trail_mult 0.75/1.0/1.5 = 27 cells) over the full covered window using this file's own semantics — daily-scale ATR, 168-bar z-history, the feed-coverage guard, 0.05% per side. ALL 27 CELLS ARE NEGATIVE (-0.07% to -2.16% average net per trade) and trade counts run 4 to 20. The loosest cell reaches only 20 trades in 102 days — an order of magnitude under the ~100-trade floor and also among the worst-performing (-0.70%). Critically, the long leg is 1-10 trades in every cell: the covered window is a single BTC downtrend, so buy-the-long-liquidation-dip is essentially untested at ANY parameter setting. That is the decisive point — the mechanism-is-absent and the sample-is-one-adverse-regime explanations cannot be separated on this data, which is what makes the hypothesis unmeasurable rather than merely unprofitable, and no code I write can change it. I therefore left the parameters at their honest structural defaults (240h SMA, flush_z 1.5, 1.0 daily-ATR trail) and added only a documentation block recording this; picking the least-negative cell would be best-of-N mining on a sample that cannot populate a 3-window walk-forward or a 15-day holdout. There is zero regression risk to the passing layers: imports, class structure, signal, gate, exits and sizing are byte-for-byte identical to the version QA verified (including the iteration-2 fix that made _z an instance method for the Layer-2 proxy). FOR THE RESEARCH LEAD: this hypothesis becomes decidable only after the liquidation feed accrues roughly 2+ more years, so it should be re-proposed later rather than iterated now. If the trend-gated counter-trend capitulation IDEA is worth testing sooner, it needs a forced/aggressive-flow trigger that is backfillable — the taker buy/sell volume ratio and open-interest drops both live in the multi-year Vision mirror and both mark aggressive one-sided flow — but swapping the trigger changes the mechanism and is a new hypothesis for them to commission, not something I should smuggle in under this one.
Hypotheses
Structurally unmeasurable — not worth 2 hours of optimization. The Binance liquidations feed only begins 2026-04-21 (the collector's start date for all 788 symbols, not a BTC-specific gap; the Vision snapshot backfill was discontinued), so despite the intent this backtest spans only 134 days and produces just 11 trades in a single BTC-downtrend regime — an order of magnitude below the ~100-trade floor, and a span too short to populate the 3-phase walk-forward and holdout windows. The attractive headline (Sharpe 2.19, PF 3.60) is not significant: sharpe_ci_low is -1.14 (CI [-1.14, 4.79] straddles zero), PSR 0.866, deflated_sharpe null, and the entire +5.4% return is carried by one outlier day (2026-08-21, +5.37%). The long leg of the hypothesis is essentially untested (4 long trades). No parameter change reaches history that does not exist, and the developer's own analysis verified the deeper history is unrecoverable and pre-registered abandonment. This is a data-availability wall, not a code defect. Failure pattern: structurally unmeasurable short-lookback liquidation feed, single-regime 11-trade sample, headline driven by one day (L27/L10).
Implementation
Long/short BTCUSDT USD-M perp on 1-HOUR bars. An established multi-day trend (tanh of price distance from a 240-hour SMA) supplies direction; the Binance forced-liquidation feed supplies entry timing. signal = max(trend_w,0)*z(long-liquidation USD) - max(-trend_w,0)*z(short-liquidation USD), where each z is a rolling score of log1p(notional summed over the trailing 3 hours) against the instrument's own 7-day liquidation distribution. A large positive signal = weak longs being force-liquidated into a dip inside an uptrend (BUY the flush); a large negative signal = trapped shorts force-covering into a pop inside a downtrend (SELL the pop). Trend-aligned flushes and no-regime periods collapse the signal toward zero and nothing trades. The only exit is an ATR trailing stop measured in daily ranges (mean of 14 24-hour high-low ranges), so a winner rides the continuation for days. Risk-first sizing: 1% of equity risked at the trailing-stop distance, capped at 25% of equity notional, leverage 1x. Three tunable parameters: trend_lookback_hours, flush_z, atr_trail_mult.
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
Clean, faithful, look-ahead-free implementation on a genuinely orthogonal forced-flow feed; per-trade edge above the fee floor (avg_trade_return_pct 2.1%)
Backtest Review
Headline metrics superficially attractive (Sharpe 2.19, PF 3.60, DD 2.6%, win rate 64%)
Backtest Review
Structurally unmeasurable: the liquidations feed only begins 2026-04-21 (collector start, not a BTC gap), so data_days is 134 and the strategy takes just 11 trades in a single ~4-month regime
Backtest Review
No statistical significance: sharpe_ci_low -1.14 (CI [-1.14, 4.79] straddles zero widely), PSR 0.866, deflated_sharpe null
Backtest Review
Headline is one outlier day: 2026-08-21 +5.37% (largest_win $5,347) carries essentially the whole +5.4% return; remove it and it is ~flat
Backtest Review
The long half of the hypothesis is untested — only 4 long trades — because the covered window is one BTC downtrend; walk-forward/holdout cannot populate on 134 days / 11 trades
Backtest Review
No deeper history is recoverable (developer verified the liquidations table starts 2026-04-21 for all 788 symbols; Vision snapshots discontinued), and the developer pre-registers ABANDON
Iteration History
Verification failed (Layer 2 — synthetic scenarios):
Parameters used: ['flush_z', 'atr_days', 'trend_scale', 'min_notional', 'min_z_samples', 'atr_trail_mult', 'risk_per_trade', 'max_notional_frac', 'flush_window_hours', 'liq_z_window_hours', 'trend_lookback_hours']
Check that __init__ sets all attributes from self.parameters.get().
- steady_uptrend: TypeError: TrendAlignedCapitulationEntryLS._z() takes 2 positional arguments but 3 were given (bar timestamp: 1735714080000)
- steady_downtrend: TypeError: TrendAlignedCapitulationEntryLS._z() takes 2 positional arguments but 3 were given (bar timestamp: 1735714080000)
- flat_ranging: TypeError: TrendAlignedCapitulationEntryLS._z() takes 2 positional arguments but 3 were given (bar timestamp: 1735714080000)
- volatility_spike: TypeError: TrendAlignedCapitulationEntryLS._z() takes 2 positional arguments but 3 were given (bar timestamp: 1735714080000)
- zero_volume: TypeError: TrendAlignedCapitulationEntryLS._z() takes 2 positional arguments but 3 were given (bar timestamp: 1735714080000)
- price_gap: TypeError: TrendAlignedCapitulationEntryLS._z() takes 2 positional arguments but 3 were given (bar timestamp: 1735714080000)
Iteration History
Verification failed (Layer 4 — QA review):
- STRUCTURALLY UNMEASURABLE — the liquidation feed covers only ~103 days, and the result over that single-regime window is negative. The developer honestly discloses that the Binance liquidations feed is LIVE-ACCRUED only (Vision historical backfill discontinued), so BTCUSDT holds just 67,449 events spanning ~103 days; the strategy can only be evaluated over that window regardless of backtest span. The sandbox produced only 6 trades (all short — a single downtrend regime, so only the short-squeeze leg fired), which cannot populate the 3-window walk-forward or holdout and is far below the ~100-trade floor. Over that window it is negative: -0.81%, Sharpe -0.34 (CI [-2.01,+1.36]), PF 0.53, avg_trade -0.40%, and the developer's own 36-cell grid was 'mostly slightly negative' (correctly not tuned away). NOT the L17 defect signature (win 0.5, PF 0.53, correct polarity) — a weak result on an unmeasurable single-regime sample. The constraint is data availability, not code: no target/stop/window change adds trades the feed doesn't cover.
- Code correctness verified — clean, faithful, iteration-2 Layer-2 fix correct. Converting _z from staticmethod to instance method resolved the proxy TypeError (all 6 synthetic scenarios pass; 'frozen 0.0' is correct no-liquidation behavior). Signal polarity correct: max(trend_w,0)*z_long_liq - max(-trend_w,0)*z_short_liq gives BUY for a long-liq flush in an uptrend and SELL for a short-liq squeeze in a downtrend, with trend-aligned/no-regime collapsing toward zero — faithfully the trend-gated counter-trend capitulation entry, distinct from the falsified unconditional overshoot-fade. No look-ahead (flush window (ts-window, ts], strictly completed events; feed-coverage guard returns None before the first event so no fictitious zero). Daily-scale ATR (mean of 24h ranges) is the right exit scale for a multi-day continuation. Risk-first capital-relative sizing, 25% cap. Divisions guarded (sd, price, stop_pct, sma); _hist trimmed (the 'unbounded' warnings are false positives). No code action required.
Iteration History
Verification failed (Layer 4 — QA review):
- STRUCTURALLY UNMEASURABLE + NEGATIVE — ABANDON (QA concurs with developer, iteration 3). The code is correct and faithfully implements the hypothesis (multiplicative trend x counter-trend-liquidation gate, correct polarity — buy long-liq flush in uptrend / sell short-liq squeeze in downtrend, no look-ahead via half-open window ending at ts_event, daily-scale ATR trailing stop, risk-first capped sizing). This is NOT a code defect. The binding constraint is the liquidation feed: it is live-accrued-only (Binance discontinued the Vision liquidationSnapshot backfill) and the PostgreSQL table — the sole source the backtest reads — starts 2026-04-21 for EVERY one of 788 symbols (collector start date, not a BTC gap), giving ~102 days for BTCUSDT. Consequences, both verified by the developer this iteration: (1) Sample is unmeasurable — the sandbox produced 6 trades (all SHORT); a 27-cell sweep of the firing-rate axes (flush_window_hours 1/3/6 x flush_z 0.75/1.0/1.5 x atr_trail_mult 0.75/1.0/1.5) yields 4-20 trades per cell, the loosest reaching only 20 over 102 days — an order of magnitude below the ~100-trade floor and unable to populate a 3-window walk-forward or 15-day holdout. (2) Negative and one-directional — ALL 27 cells are net-negative (-0.07% to -2.16%/trade), the sandbox shows -0.81% total, avg_trade_return_pct -0.40%, Sharpe -0.34, PF 0.53. The covered window is a single BTC downtrend, so the long/capitulation half of the hypothesis (1-10 trades in every cell) is essentially untested — mechanism-absent and one-adverse-regime cannot be separated on this data.
Backtest and paper results are hypothetical. Trading involves risk of loss.