Skip to content

View translation

BtcTakerFlowConfirmedMomentumLS

Hypotheses

BTC Taker-Flow-Confirmed Momentum, Long-Short (Single-Instrument BTCUSDT.BINANCE Perp, 4H Bars — Trade Price Momentum ONLY When Aggressive Taker Order-Flow Confirms the Same Direction, Flat Otherwise, ATR-Trailing, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument strategy on BTCUSDT.BINANCE USD-M perpetual that trades 4H price momentum ONLY when the AGGRESSIVE TAKER order-flow (taker buy volume ÷ total volume) confirms the same direction — a genuinely NEW EDGE SOURCE (order flow, not price) that this session's exhaustive price-only failures have not tested fairly. It is a deliberate pivot on the hardest lesson learned: single-instrument PRICE signals have no directional edge on any alt (XRP and LINK momentum-confluence both died 'no latent edge'; SOL/BTC-HL breakout/MR/channel all negative) and the ONE proven edge (BTC momentum confluence) is BTC-specific — so this stays on BTC (where edge demonstrably exists) but adds an ORTHOGONAL confirmation axis, aggressor imbalance, which reflects informed/urgent demand that price alone does not reveal. It keeps the survivor's proven SELECTIVITY principle (trade direction only when a strong confirm agrees, flat otherwise) while sourcing that confirm from microstructure. It is engineered against every confirmed failure mode: kept DEAD SIMPLE for the developer — ONE supplementary scalar (taker buy ratio), the SAME instrument it trades, standard incremental smoothing — to avoid the whole-strategy-swap that killed prior supplementary/tick ideas; 4H cadence for a MEASURABLE ~150-250 trade sample (not a low-frequency gate); BTC 4H moves (~2-4%) that clear the ~0.10% fee. It fills the under-target LONG-SHORT bucket (13.4% vs an 86%-long-only book) and diversifies the book's edge source away from pure price momentum. Only 3 parameters.

Hypotheses

QA's diagnosis is the important one and I accept it: loosening the gate ~4x plus merging both aggressor sources moved the count only 4 to 6, which is the signature of a COVERAGE ceiling rather than selectivity. So I did NOT loosen the confirmation again — past a directional floor that turns this into the unconfirmed price-momentum strategy already falsified this session, i.e. buying trades by abandoning the hypothesis. Instead I removed the three places where my own gating discards coverage the collected data actually has, all locked infra constants with zero change to the signal, entry, exit or sizing logic and no new tunable. First, the standardization window drops from 30 days to 14 and the minimum sample count from 30 to 12: if the merged series is coarse in places (daily-granularity metrics rows rather than hourly API rows), demanding 30 samples inside a trailing 30 days silently requires ~30 calendar days of continuous coverage before the first tradeable bar and re-blanks after every gap; 14 days with 12+ observations is still a legitimate z-score but starts sooner and resumes sooner. Second, the staleness tolerance goes from 24h to 72h: the reading is a 24h-smoothed measure, not a tick-level trigger, so bridging a multi-day collection gap with the most recent real sample is a lag rather than a fabrication, whereas a 24h rule blanks every bar following any gap longer than a day. Third, diagnostics are now decisive rather than inferential — on_stop reports flow_missing_pct explicitly with a note that a high value means coverage, and the series log now includes span_days and median_gap_hours, so the next reviewer can read the cause directly instead of deducing it from the trade count. Everything that passed Layers 1-3 is untouched: same imports, same class, same continuous signal and warmup fallback, same O(log n) prefix-sum flow reads and index-based bar access, same hysteresis exits, same risk-anchored sizing, still exactly 3 tunables. The honest bound, and I want it on the record: these changes can only recover coverage the series genuinely contains. If entries stay in the single digits or teens, the taker-flow series does not span this window for BTCUSDT, the hypothesis is untestable with the data available, and the right call is to ABANDON rather than iterate a fourth time — the remaining fix is data-side (collect a multi-year aggressor series), not code-side, and no threshold can manufacture coverage. Check flow_missing_pct in the log before deciding.

Hypotheses

Marginal, not-significant BTC momentum variant whose edge decayed into the holdout window — not worth 2 hours of optimization. Base Sharpe 0.74 with bootstrap CI [-0.033, 1.425] straddling zero and PSR 0.784 (<0.95) means the result is not distinguishable from no-skill even before the ~225-trial deflation, which only lowers it. The +57.8% is outlier-driven (2023-01-18 +21%, 2024-02-17 +13.8%; kurtosis 9.4) and concentrated in 2023 (+11%) and 2024 (+22%), while 2025 (+1.1%) and 2026 (-1.0%) are dead — and the last-20% holdout window sits squarely in that dead regime, so the unwaivable holdout hard gate (Sharpe > 0, >=10 trades) would very likely fail. It also lands below the BTC-momentum survivor bar (L82: first-backtest Sharpe >1.3 / PF >2.0; this is 0.74 / 1.845). The per-trade edge (0.907%) and low DD (8.88%) are real, so this is not fee-dead, but the developer's own contemporaneity caveat — taker-flow measured over the same window as the momentum leg — means the confirm may just re-encode price momentum, i.e. the single-instrument price-momentum class already falsified this session. Failure pattern: no_edge/overfit single-instrument BTC momentum, not significant, holdout regime dead (L63/L82).

Implementation

Long/short 4H price momentum on the BTCUSDT.BINANCE USD-M perpetual, taken only when aggressive taker order flow confirms the same direction. Momentum is the close-to-close change over mom_lookback bars in ATR units; the confirm is the taker buy/sell imbalance (2*takerBuy/(takerBuy+takerSell)-1) read from the merged taker_ratio + metrics series, smoothed over 24h and standardized as a rolling z-score against its own trailing 14 days (12+ samples). The signal is momentum scaled by confirmation strength min(1, |z|/flow_thresh) when flow and price agree, and a clipped residual when they disagree, so unconfirmed momentum can never trip an entry. Entry is a fresh cross of +/- entry_thresh_atr while flow confirms directionally beyond 0.25 x flow_thresh, so weak flow demands proportionally more momentum. Exits are momentum reaching exit_hyst_atr against the position, a flow reversal past the full flow_thresh the other way, or an ATR trailing stop. Where the flow series is missing or staler than 72h the strategy takes no position — no price-only fallback. Sizing risks a locked 2% of equity to the trailing stop, capped at 1x equity notional and floored at BTC's 0.001 step and the $100 BTCUSDT minimum. Three tunables: mom_lookback, flow_thresh, trail_atr_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.

Verification Results

Confirmation may not be orthogonal to the signal it confirms: the taker-flow imbalance (24h-smoothed) overlaps the mom_lookback price window, so a rising price and a buy-skewed aggressor reading are partly the same information. Validity/edge question (not a look-ahead — reads are point-in-time), flagged by the developer for backtest review. A/B flow-gated vs un-gated momentum; if the gate doesn't improve edge, the confirm is redundant with price and the premise fails.

Verification Results

Thin/uneven supplementary coverage: exposure 8.79% and multiple 2020-2022 stress windows at 0.0 return indicate the taker series doesn't span the full bar history; the strategy is correctly flat where flow is absent (no fallback), so the 80-trade sample sits on a limited, likely-recent sub-window. Read flow_missing_pct/span_days from on_stop; evaluate on the covered window and weight the holdout for recency bias.

Backtest Review

avg_trade_return_pct 0.907% is well above the ~0.10% BTC round-trip — a genuine per-trade edge, not fee-fragile

Backtest Review

Low max_drawdown 8.88% and PF 1.845; 80 trades is a workable (if borderline) sample

Backtest Review

BTC USD-M momentum is the one OHLCV class with a promotion (L82), and the taker-flow axis is a novel orthogonal source

Backtest Review

Base Sharpe 0.74 with bootstrap CI [-0.033, 1.425] straddling zero and PSR 0.784 (<0.95) — not significant even before the ~225-trial deflation, which only lowers it

Backtest Review

Returns are outlier-driven (2023-01-18 +21%, 2024-02-17 +13.8% carry the result; kurtosis 9.4) and concentrated in the 2023-2024 bull

Backtest Review

Recent regime is dead: 2025 +1.1%, 2026 -1.0%. The last-20% holdout window falls squarely here and would likely fail the unwaivable holdout hard gate (Sharpe ≤ 0)

Backtest Review

Below the L82 BTC-momentum survivor bar (Sharpe >1.3 / PF >2.0); contemporaneity caveat means the taker-flow confirm may not be orthogonal to the price momentum leg

Iteration History

Verification failed (Layer 4 — QA review): - UNMEASURABLE SAMPLE -- 4 trades, and the sandbox itself flags it. total_trades=4 over 363 data_days with metrics_reliable=FALSE, Sharpe -0.78 (CI [-2.06, 0.84]), PF 0.156, avg_trade_return_pct -0.895%, return_skew -3.27 / kurtosis 86.6 (one bad trade dominates, largest_loss -$1457 vs avg_win $209). The hypothesis projected ~150-250 trades over multi-year history; the sandbox delivered ~4/year -- a ~40x shortfall that makes the run statistically empty (no metric here can be trusted). The cause is an OVER-SELECTIVE COMPOUND GATE: entry requires the momentum signal to FRESHLY CROSS +/-entry_thresh_atr AND the taker-flow z-score to simultaneously satisfy |z| >= flow_thresh (1.0) in the SAME direction AND the previous bar to not already be eligible. Requiring a momentum-threshold cross to COINCIDE on the same 4H bar with an independently-confirmed flow extreme is exactly the multiply-selective 'breakout AND regime' filter that collapses trade counts toward zero (L25), and a sub-10-trade sample cannot distinguish edge from noise (L16). A secondary possibility that would compound it: if the taker_ratio supplementary series covers only part of the 363-day window (the no-substitution rule correctly makes the strategy flat wherever flow is absent/stale/too-short-to-standardize), the tradeable span is even smaller -- either way, unmeasurable. - CONTEMPORANEITY CAVEAT (developer-flagged, for the analyst if a measurable version is achieved). Taker-flow imbalance is contemporaneous with the price bar, so part of the aggressor signal is mechanically the same information as the momentum leg -- the 'confirmation' may not be orthogonal enough to add directional information beyond price. This is not verifiable at n=4; note it for BACKTEST_REVIEW once the sample is measurable.

Iteration History

Verification failed (Layer 4 — QA review): - STILL UNMEASURABLE -- the measurability fix barely moved the count (4 -> 6 trades), which points to a DATA-COVERAGE ceiling, not selectivity. total_trades=6 over 363 days, Sharpe 0.079 (CI [-1.60, 1.62], straddles zero), PF 1.14, avg_trade_return_pct -0.043%, return_kurtosis 37.2 (one trade dominates) -- statistically empty, and metrics_reliable=true should not be read as trustworthy at n=6. The developer's iteration-2 changes were the right diagnosis-driven moves (relax the entry from a same-bar |z|>=1 flow TAIL to a directional floor of 0.25*flow_thresh, moving conviction into the graded signal; and MERGE taker_ratio + metrics to widen coverage). Critically, loosening the confirmation gate ~4x (|z|>=1.0 -> |z|>=0.25) AND merging both aggressor sources should have multiplied trades several-fold IF selectivity were the binding constraint -- instead it produced 2 more trades. That is the signature of COVERAGE: the merged taker-flow series (plus the 30-sample / 30-day standardization warmup and the 24h staleness guard) spans only a small fraction of the 363-day window, and the no-substitution rule correctly makes the strategy flat everywhere flow is absent. So 6 trades is a data ceiling on this instrument/window, not a threshold that can be tuned open without diluting the confirmation into the unconfirmed-momentum strategy already falsified this session. - CAPACITY / IMPACT also weak (secondary, and unreliable at n=6): capacity_usd $3.08M with impact_cost_pct 18.0% -- even if a measurable sample existed, the impact is high and capacity small relative to a deployable book. Not trustworthy at 6 trades, but flagged so it is checked once (if) the sample is measurable.

Iteration History

Verification failed (Layer 4 — QA review): - ABANDON -- UNTESTABLE WITH THE AVAILABLE DATA (a coverage ceiling, not a strategy defect), and the developer's own pre-committed criterion is met. Across three iterations the trade count moved 4 -> 6 -> 10, and every one of those moves was a COVERAGE-recovery change (iter2: relax the gate + merge sources; iter3: z-window 30d->14d, min samples 30->12, staleness 24h->72h) -- none of which touched selectivity. That trajectory is decisive: maximizing every legitimate lever for reading the collected taker-flow series still yields only 10 trades over 363 days, so the merged taker_ratio + metrics aggressor series simply does not span this window for BTCUSDT. total_trades=10 is unmeasurable (Sharpe -0.095, CI [-1.84, 1.42] straddling zero, PF 0.938, avg_trade_return_pct -0.218%, return_kurtosis 33.5 -- one trade dominates; metrics_reliable=true is not trustworthy at n=10). The developer stated the test in writing: 'if entries stay in the single digits or teens, the taker-flow series does not span this window for BTCUSDT, the hypothesis is untestable with the data available, and the right call is to ABANDON rather than iterate a fourth time -- the remaining fix is data-side, not code-side.' Entries = 10; the criterion is met. - Do not read the n=10 metrics as edge in EITHER direction. avg_trade_return_pct -0.218% / PF 0.938 look mildly negative but are pure noise at 10 trades (kurtosis 33.5, one trade dominates; avg_position_pct 63% is also hotter than siblings). The contemporaneity caveat (taker-flow imbalance measured over the same window as the price move, so partly mechanically the same information as momentum) remains the likely edge risk IF a measurable sample is ever obtained -- but that assessment cannot be made here and must wait for a data-complete run.
Strategy report

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