Skip to content

View original

BtcTrendSmartMoneyConfirmedLS

Hypotheses

BTC Perp Trend Confirmed by Smart-Money Positioning, Long-Short (Single-Instrument BTCUSDT.BINANCE USD-M — Take a Medium-Term Price Trend ONLY While the TOP-TRADER Long/Short Account Ratio Is Tilted the SAME Way, Flatten on Smart-Money Divergence or Vol Spike, Low-Leverage Defined-Risk, 3-Parameter)

Hypotheses

A LONG-SHORT, SINGLE-INSTRUMENT, SINGLE-VENUE trend strategy on BTCUSDT.BINANCE USD-M that follows the ONLY archetype proven to survive this factory (single-instrument BTC momentum, long-short, trailing-managed) but obeys L38 by adding a GENUINELY NEW information source rather than another price gate or a symbol swap: the TOP-TRADER long/short ACCOUNT ratio (Binance's positioning of the largest/most-informed accounts), a supplementary series not used in any of my pending hypotheses (which use OI, taker-flow, price-structure, and funding was fatal). The idea: a medium-term price trend is only trustworthy when INFORMED money is leaning the same way. Go long a confirmed up-trend ONLY while the top-trader L/S ratio is elevated/rising (smart money net-long and adding); go short a confirmed down-trend ONLY while top-trader L/S is falling (smart money net-short); FLATTEN when price trend and smart-money positioning DIVERGE (the move is retail-driven and unsupported). This is distinct from my ETH price-OI quadrant (total open interest, not WHICH cohort is positioned), from the dead crowding-FADES (this FOLLOWS informed money, it does not fade the retail crowd), and from the dead 'informed-positioning basket' (that was a long-only, low-turnover, no-trades BASKET; this is a single-name, long-short, trend-timed strategy that actually trades). Crucially it is engineered against the two things that just killed my perp ideas: leverage is capped at 1.5x with a hard per-trade stop AND a volatility circuit-breaker that flattens during crash-vol spikes, so the 77%/100% drawdown blow-ups (DOGE/SOL) are impossible; and it is LOW-FREQUENCY on 12h/daily bars holding multi-day trends, so the ~0.10% USD-M round trip is immaterial (no fee_edge fragility). One instrument, one venue, one cheap series, pure incremental computation — none of the options/cross-venue/multi-leg machinery that dies in verification. 3 parameters, to resist overfitting.

Hypotheses

The QA reviewer was right and my frequency validation was wrong; I root-caused the ~40x error rather than guessing. Two compounding mistakes. (1) I counted BARS where |signal| >= 0.70 as entries, but crossings arrive in contiguous clusters and entries only occur while flat, so ~153 crossing bars is roughly 8 episodes, not 153 trades. (2) Worse, my dry-run read the metrics parquet with a RECURSIVE glob (709 files); the engine's supplementary loader in pipeline_processor._collect_supplementary_data globs `search_dir.glob('*.parquet')` NON-recursively and therefore sees only the 304 flat files, with 405 files under `_attic` invisible to it. On the feed the engine actually gets, 40.5% of 12H bars have no positioning point inside the bar window. I rebuilt the dry-run as a faithful flat/in-position state machine reading ONLY the engine-visible files, and it reproduces the sandbox: 5 trades in the last 365 days versus the 4 observed. That validated model is what I then used to choose the fix. The dominant defect was a data-handling bug, not the signal: the old guard `not np.all(np.isfinite(window))` blanked the signal whenever a single gap fell anywhere in the 40-bar positioning window, which with a 40% gap rate killed 52% of ALL bars. Replacing it with NaN-aware statistics over the finite observations (subject to a minimum count of 8) plus raising smart_max_stale_hours from 72 to 168 cuts dead bars to 28% and lifts the validated count from 69 to 130 trades over the full 2020-09 to 2026-07 history (22.7/year, 15 in the sandbox year, ~43 per walk-forward window), clearing the ~100-trade floor and the thin-window objection. Crucially, avg trade return RISES to +0.597% (4x the 0.15% futures fee floor) and I changed NONE of the three searched parameters -- trend_lb 20, pos_lb 40, entry_thresh 0.70 are exactly as before, so this is a data-quality repair rather than a retune, and the quantity scored is identical (bridging collection gaps in a slow-moving positioning state variable, with no lookahead: _smart_at still never reads a point later than the bar). I explicitly rejected the alternatives that buy trades by destroying the edge: 12H with halved lookbacks gives 145 trades but only +0.181% per trade, and 4H gives 214 trades at +0.139%, below the fee floor and straight into the fee_edge graveyard. For the second finding I closed the intrabar-overshoot path defensively and minimally: position_size now records the absolute stop price and should_exit tests the bar's low (long) / high (short) against it before falling through to the close-based test. I deliberately did NOT convert to an OCO bracket as I did on the ADA sibling, because the base class's orders_open guard skips _process_primary while protective children rest, which would disable the smart-money divergence flatten -- the mechanism this hypothesis is actually testing. Two honest caveats for the analyst. First, at ~23 trades/year the 15-day holdout still expects under 1 trade; that is structural for any 12H trend strategy and no parameter choice fixes it without pushing per-trade return under the fee floor, so the holdout gate should be read with that in mind. Second, the previously-disclosed substitution stands: the signal is the size-weighted top_trader_long_short_ratio, not the account-count variant, because the account-count series is 53-100% NaN for BTCUSDT in every year.

Hypotheses

Thin momentum/continuation edge that won't clear the post-optimization robustness gates. Sharpe is 0.357 with a 95% CI [-0.31, 0.96] that already straddles zero, profit_factor is only 1.24 (barely above the meaningful line), information_ratio is -0.64, and there are just 127 trades over 6.5 years. Performance is inconsistent across regimes (2020 -6.0%, 2024 +0.06%, 2025 -14.2% with rolling Sharpe -5) — the smart-money confirmation signal has decayed in the recent regime, exactly the pattern that produces a negative holdout. avg_trade_return_pct 0.88% clears the fee floor, so this is not fee-fragility — the problem is that the risk-adjusted edge is not distinguishable from zero. This is the OHLCV+positioning momentum/continuation class (L9/L41, zero survivors); the optimizer selecting the best of ~225 trials on a Sharpe-0.36 signal would inflate it on noise, and the realistic OOS ceiling won't reach the 0.5 minimum. Two much stronger siblings this session (vol-normalized momentum Sharpe 0.86 PF 1.51, ensemble-vote Sharpe 0.79 PF 1.19) just failed ANALYZING on DSR≈0 / PBO>0.5 / negative holdout; a candidate entering at Sharpe 0.36 / PF 1.24 has no realistic path. Abandon rather than spend 2 hours reaching a near-certain overfit-abandon.

Implementation

Long-short medium-term trend strategy on BTCUSDT.BINANCE USD-M 12-hour bars that takes a price trend only while Binance's top-trader (smart-money) positioning leans the same way. The signal is unchanged: trend_z (vol-normalized 20-bar momentum) and smart_z (z-score of the top-trader long/short ratio over 40 bars) fused into the continuous confluence score 0.25*(trend_z+smart_z)*(1+tanh(trend_z*smart_z)), which carries their average strength when aligned and decays smoothly toward zero on divergence. Entry is a single threshold (|signal| >= 0.70); exits are the vol circuit breaker, an ATR stop now tested against the bar's intrabar extreme, a trailing give-back armed at 1.5R, and the smart-money divergence flatten. This iteration fixes the trade-count defect by scoring the positioning window with NaN-aware statistics and carrying a stale positioning observation for up to 7 days instead of 3.

Verification Results

Verification failed (Layer 4 — QA review): - STRUCTURALLY UNMEASURABLE TRADE COUNT, and the developer's own frequency validation is wrong. The rationale claims a dry-run of '68 long and 85 short threshold crossings' (153 entries) over the 365-day sandbox window, but the ACTUAL sandbox produced only 4 trades over 329 days, and the engine set metrics_reliable=false. The dry-run conflated 'bars where |signal| >= 0.70' with entry events; in the real backtest, entries occur only when flat, and the confluence gate — signal = 0.25*(trend_z + smart_z)*(1 + tanh(trend_z*smart_z)) >= 0.70 requires BOTH a strong vol-normalized trend AND a strongly-aligned smart-money z-score simultaneously, which is far more selective than the crossing count implies. Four trades cannot distinguish edge from noise (win_rate 0.25, profit_factor 0.33, Sharpe -0.56 with CI [-2.11, 1.12] are meaningless at n=4), and extrapolating ~4/year over the full multi-year history gives ~24 trades total — below the ~100-trade floor and unable to populate the 3-window walk-forward (~8 trades/window) or the 15-day holdout (~0 trades). This is the same measurability standard on which the BTC regime sibling (1 trade) and the ETH-quadrant daily version (~9) were rejected, and it is compounded here because the frequency estimate that justified advancing was off by ~40x. - Latent close-based-stop risk (contained here, but the same family that blew up the ADA/XRP siblings). should_exit evaluates the hard stop on the 4h/12h CLOSE (get_position_pnl_pct at self._last_close, pnl_pp <= -stop_pp) rather than the bar's intrabar extreme, so a violent bar can trade through the stop and only exit at the next close. Unlike the ADA case this did NOT blow up in the sandbox (max_drawdown 3.6%, largest loss ~2.7%, avg_position 31%) because leverage is only 1.5x and the vol circuit-breaker flattens crash bars — the risk design is genuinely more conservative. But the intrabar-overshoot path is still present and should be closed defensively before this trades at size. - Data-variant deviation from the hypothesis (developer-flagged, acceptable but worth recording). The hypothesis names the top-trader long/short ACCOUNT ratio, but that exact series is 53-100% NaN across 2020-2026 for BTCUSDT, so the code uses the position-weighted top_trader_long_short_ratio (same top-trader cohort, complete history) as the backbone, falling back to top_account_ratio only when the metrics series is entirely absent. This is a reasonable, honestly-disclosed substitution within the same informed-cohort family and is not a mechanism swap, but the analyst should note the signal is size-weighted rather than account-count-weighted positioning.

Verification Results

At backtest_review, evaluate on the full 2020-2026 window; confirm avg_trade_return_pct actually reaches the claimed ~+0.6% and profit_factor > 1.0 across regimes. If the full window is also a net loser with the tail contained, abandon the flow/positioning-confirmed momentum mechanism rather than re-tuning.

Verification Results

Measurability blocker resolved, but the sandbox shows no in-sample edge — an edge question for backtest_review. The re-diagnosis and NaN-aware fix lift the sandbox from 4 trades (which failed the prior review) to 15, metrics_reliable now true, with a validated full-history count of 130 (~22.7/yr, ~43 per walk-forward window) clearing the ~100-trade floor. HOWEVER, the sandbox is a mild net loser: total_return -0.75%, profit_factor 0.93, win_rate 0.33, avg_trade_return_pct -0.094% (slightly negative), Sharpe -0.07. The reward:risk is favourable (avg_win $2050 vs avg_loss $1101, ~1.86:1) but the 33% hit rate leaves expectancy marginally negative in this window; the developer's full-history model claims +0.597% per trade (4x the fee floor), so the single sandbox year is not decisive. This is not a QA correctness/risk defect — it is the analyst's call on the full multi-year backtest.

Verification Results

Weight the walk-forward OOS (~43 trades/window) far more heavily than the 15-day holdout for this candidate; do not abandon on an empty/degenerate holdout alone, and do not promote on a 1-trade holdout either.

Verification Results

The trade count clears the floor but the holdout is structurally thin. At ~22.7 trades/year on 12H bars, the final 15-day holdout expects under 1 trade — the developer flags this honestly, and it is inherent to any 12H trend strategy (the faster-clock alternatives that would populate the holdout push per-trade return below the fee floor). So the holdout gate will be near-empty and low-power; a pass/fail there must be read with that in mind rather than treated as decisive.

Verification Results

At analysis, benchmark against the same trend-follow WITHOUT the positioning gate to confirm the smart-money term earns its keep, and record that 'smart money' here means size-weighted top-trader positioning.

Verification Results

Mechanism-class caution and a disclosed data-variant substitution, both for the analyst. (a) This is momentum/trend continuation with a positioning-confirmation overlay — a heavily-mined family, though it correctly adds a genuinely orthogonal source (top-trader positioning) per L38 and mirrors the one surviving archetype (drawdown-capped directional + trailing stop). (b) The signal uses the size-weighted top_trader_long_short_ratio rather than the account-count variant the hypothesis names, because the account-count series is 53-100% NaN for BTCUSDT every year — a reasonable, previously-disclosed substitution within the same informed cohort, not a mechanism swap. Neither is a code defect.

Backtest Review

Genuinely orthogonal, L38-legal information source (top-trader long/short account ratio) — not a price clone or symbol swap

Backtest Review

Sound risk construction: 1.5x cap, hard ATR stop, vol circuit-breaker — max_drawdown a controlled 17.1%

Backtest Review

avg_trade_return_pct 0.88% is above the fee floor; not fee-fragile

Backtest Review

Positive stretch 2021-2023 and positive alpha (+0.026)

Backtest Review

Sharpe 0.357 with CI [-0.31, 0.96] straddling zero — not distinguishable from no-skill before optimization

Backtest Review

profit_factor 1.24 barely above the 1.2 meaningful line; information_ratio -0.64

Backtest Review

Only 127 trades over 6.5 years — thin for reliable parameter fitting

Backtest Review

Inconsistent across regimes: 2020, 2024 (~0), and especially 2025 (-14.2%, rolling Sharpe -5) show the signal decaying

Backtest Review

OHLCV+positioning momentum/continuation class (L9/L41, zero survivors); best-of-225 selection would inflate Sharpe on noise and near-certainly fail deflated-Sharpe/holdout in ANALYZING (as stronger siblings just did)

Outcome Summary

This strategy tried to strengthen the factory's only surviving archetype — single-instrument BTC momentum, long-short, trailing-managed — by adding a genuinely new information source: Binance's top-trader long/short account ratio, taking a trend only while informed money leaned the same way and flattening on divergence. The engineering was careful, including a NaN-aware feed repair to lift trade count and a full defended risk stack (1.5x cap, ATR stop, vol circuit-breaker) that held drawdown to 17.1%. But the backtest edge was too thin to matter: Sharpe 0.357 with a confidence interval straddling zero, profit factor 1.24, only 127 trades, and a signal that decayed badly in 2024-2025. The analyst abandoned it at backtest review rather than spend hours optimizing, reasoning that this OHLCV+positioning continuation class has zero survivors and that a Sharpe-0.36 candidate would inflate on noise and fail the deflated-Sharpe and holdout gates just as its stronger siblings had that session.

Outcome Summary

A genuinely orthogonal information source and clean, drawdown-capped construction are not enough — a momentum/continuation edge that enters review at Sharpe 0.36 / PF 1.24 with a CI straddling zero and recent-regime decay has no realistic path through the robustness gauntlet, so it is not worth optimizing.

Outcome Summary

It was abandoned at the BACKTEST_REVIEW gate: the risk-adjusted edge (Sharpe 0.357, CI straddling zero, PF barely above 1.2) is not distinguishable from no-skill, and the recent-regime decay is exactly the pattern that produces a negative holdout. The analyst judged that best-of-225 optimization on such a thin signal would inflate Sharpe on noise and near-certainly fail deflated-Sharpe/PBO/holdout in ANALYZING — as two stronger siblings had just done — so it never reached optimization.

Outcome Summary

A long-short, single-instrument, single-venue trend strategy on the BTCUSDT.BINANCE USD-M perp that follows a medium-term price trend only while Binance's top-trader long/short account ratio (an orthogonal 'smart-money' positioning series) is tilted the same way, flattening on price/positioning divergence or a volatility spike, with leverage capped at 1.5x, a hard ATR stop and a vol circuit-breaker.

Outcome Summary

The backtest was positive but thin: total return +31%, profit factor 1.24, avg_trade_return_pct 0.88% (above the fee floor), max drawdown a controlled 17.1%, over 127 trades in 6.5 years. But Sharpe was only 0.357 with a CI [-0.31, 0.96] straddling zero, information ratio -0.64, and performance was inconsistent across regimes — positive in 2021-2023 but roughly flat in 2020/2024 and -14.2% in 2025 (rolling Sharpe to -5), indicating signal decay.
Strategy report

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