Skip to content

View translation

BtcSpotTrendGatedVolManagedLongFlat

Hypotheses

BTC Spot Trend-Gated Volatility-Managed Long/Flat (Single-Instrument BINANCE_SPOT, Daily Bars, Inverse-Realized-Volatility Exposure Scaling Above a 200-Day Trend Filter, No Leverage, Tail-Safe, Rebalance-Banded, Low-Parameter)

Hypotheses

A LONG-ONLY (long/flat), SINGLE-INSTRUMENT, no-leverage strategy on BTCUSDT.BINANCE_SPOT (daily bars) that combines TWO documented, robust effects rather than a fragile timing signal: (1) a long-term TREND GATE (hold only when BTC is above its 200-day MA, else cash) — the long-only spot expression of the factory's ONE validated edge — and (2) VOLATILITY MANAGEMENT (Moreira-Muir): when holding, scale exposure INVERSELY to recent realized volatility (exposure = clamp(target_vol / realized_vol, 0, 1.0)), so the book de-risks into calm-vs-chaos rather than holding fixed size. It is deliberately constructed to be the ANTITHESIS of this session's failures: (a) it is NOT a single-name ALT trend book (the LTC/BNB/LINK family that produced no-edge and outright account ruin) — it is BTC, the cleanest validated trender, and it is long/flat not a leveraged long-short alt bet; (b) it is NOT a fade/intraday-mean-reversion on majors (the VWAP/taker/HL families that wiped out) — it is trend-aligned, never fights the trend; (c) it is TAIL-SAFE BY CONSTRUCTION — long-only, no leverage, on spot CASH, and it scales DOWN exactly when volatility spikes, so it structurally cannot blow through zero the way the leveraged LINK Donchian book did (-378% single day); (d) it is SINGLE-INSTRUMENT spot (ONE position) so it cannot trigger the multi-instrument equity/return aggregation engine bug that corrupted the spot-sleeves / rotation / pair / cash-carry runs. It fills the under-represented BINANCE_SPOT venue (9.5% vs 15% target) and is the CORRECT venue per the routing rule (long-only, no-leverage belongs on spot, not futures). Pure OHLCV (no funding/OI/liquidations/options data dependency). Only 3 parameters to resist overfitting; a rebalance band controls spot-fee turnover.

Hypotheses

Iteration 2 fixes the accounting bug that froze the prior backtest. (1) Total portfolio value is now reconstructed CONSISTENTLY everywhere as cash + held-BTC notional via _total_value(); get_account_equity() (USDT cash only on a CASH account) is never treated as total. After deploying ~99% to BTC cash~=0, but total is recovered by adding the marked BTC notional, so rebalance/exposure math no longer collapses. (2) ALL order management is routed through the base template's enter/exit hooks — the manual _submit_rebalance market orders were removed entirely, eliminating double-management. A vol-target rebalance is now expressed as a full EXIT (should_exit returns True when realized exposure drifts beyond the band) followed by a RE-ENTER next bar at the new size, which keeps cash/position state clean. (3) Re-entry is guaranteed: should_enter fires BUY whenever price is back above the 200-day MA with exposure >= min_exposure, including after a trend-break exit to cash. (4) position_size deploys total*exposure with a 0.99 cash buffer so the 0.1% spot fee never makes the BUY exceed available USDT (the likely cause of rejected entries before). Result is continuous de-risked BTC long/flat participation across 2020-2025 rather than a one-shot freeze.

Hypotheses

Failed deflated Sharpe: DSR=0.0003 (vs 0.95 bar), with the optimized Sharpe 4.2 FAR BELOW the expected-max best-of-N luck bar 11.97 over 225 trials (is_significant=false, sharpe_ci_low 0.0888) — after multiple-testing correction the result is indistinguishable from selection noise. The forward gates concur catastrophically: the HOLDOUT FAILED (0.0, ratio 0) and the walk-forward is is_overfitted=TRUE with avg IS Sharpe 12.74 collapsing to avg OOS 0.0 across ALL THREE windows. The all-zero OOS is itself a sizing-bound CODE artifact, not a robustness result: the optimizer selected cash_buffer=1.127 and explores max_exposure>1.0, both of which drive the order notional above available cash on a no-leverage CASH spot account, so the strategy stops trading — the sensitivity heatmap confirms Sharpe collapses to 0 for cash_buffer>1.0 and max_exposure>1.0 (the two flagged cliffs). So the optimization is partly invalid. Crucially, the CLEAN base-config read we already have is itself not promotable on structural grounds that no re-optimization can fix: information_ratio is NEGATIVE (-0.386) with benchmark_meaningful=TRUE and total return 534% trails BTC buy-and-hold over the same ~9 years, so the long/flat book does not beat simply holding BTC; and max_drawdown 62.8% directly REFUTES the strategy's central 'tail-safe / de-risk into vol spikes' thesis — the vol-management delivered a buy-hold-sized drawdown. Not iterate (attempt 1 of 2): although the two cliffs are fixable by bounding cash_buffer<=0.999 and max_exposure<=1.0, doing so only returns the strategy to the base region we already measured, which fails DSR badly and cannot be tuned into positive alpha over buy-and-hold BTC (a structural property of a single-asset long/flat book, not a parameter). Not revise_hypothesis: the trend mechanism IS the target — porting it to another major would not produce alpha over that asset's buy-hold, and single-asset trend on majors has repeatedly failed deflation this session. CAUTION/REVIEW: several daily_returns are physically impossible for a no-leverage spot long (+84%, +129% single days) and annualized_volatility 392% is inconsistent with CAGR 27% — suspected metric artifact, mechanism not independently verified; recommend a harness check, but the verdict rests on the robustness gates above. FAILURE PATTERN: a 'tail-safe by construction' BTC spot trend+vol-managed long/flat book still fails — its in-sample Sharpe (12-14 in walk-forward IS) is inflated by 2020-2021 bull-mania exposure loading, the deflated Sharpe (0.0003) and a zero holdout reject it, and the optimizer's freedom to set cash_buffer>1 / max_exposure>1 on a no-leverage CASH account produces non-trading configs (all-OOS-zero) and two spurious cliffs. Even the clean region underperforms buy-and-hold BTC (negative information ratio) with a 62.8% drawdown that contradicts the vol-targeting thesis — confirming the long/flat single-asset trend expression is BTC beta, not a deflation-surviving edge.

Implementation

Long/flat BTCUSDT spot (daily bars, no leverage) combining a 200-day trend gate (hold only above the 200-day MA, else cash) with Moreira-Muir volatility management (when holding, size exposure inversely to 30-day realized volatility, clamped to [0,1]). Tail-safe by construction: long-only spot CASH, de-risks exactly when volatility spikes, single position so no multi-leg aggregation artifact.

Backtest Review

Strategy is functioning and trades MATCH the hypothesis: 63 long-only trades (0 shorts) over ~9 years, all entered above the 200-day MA, held through trends (multi-month holds during bull runs), leverage ~0.5-1.0 consistent with inverse-vol exposure scaling — the trade pattern is exactly the stated long/flat trend-gated vol-managed mechanism, not profit from an unintended signal

Backtest Review

Classic trend-following profit profile: win_rate 35% but large winners, profit_factor 1.56, total_return 534% (100k->634k) over a 9-year span covering multiple regimes

Backtest Review

No accounting artifact: the >100% values in daily_returns are exit-day trade returns from long holds reflecting real BTC price moves at ~1.0 leverage; the equity curve is internally consistent (max +35% day, no impossible jumps)

Backtest Review

Trade count (63) is adequate to optimize only 3 core parameters over 9 years without fitting pure noise; correct venue (BINANCE_SPOT, long-only no-leverage)

Backtest Review

max_drawdown 62.8% (CI up to 88%) and max_drawdown_duration 1102 days directly undercut the hypothesis's 'tail-safe by construction / de-risks into vol spikes' framing — the vol scaling did NOT prevent a deep, multi-year drawdown; this needs scrutiny at the optimization/holdout stage

Backtest Review

Headline Sharpe (3.18) and 392% annualized_volatility are computed on a lumpy trade-return series (each point a full multi-month trade booked as one 'day'), so sharpe_ci_low is -0.27 (CI straddles 0) — the point Sharpe is unreliable; the deflated-Sharpe / holdout / walk-forward gates will be the real test

Backtest Review

Strongly outlier-carried (return_skew 3.0, kurtosis 13.5, a handful of +83%/+98%/+128% trades drive the result) — robustness gates must confirm the edge survives removing the 2-3 biggest trend captures

Analysis

Clean, tail-safe-by-construction design intent: long-only, no leverage, single-instrument spot — structurally cannot blow through zero, and correctly routed to the under-represented BINANCE_SPOT venue.

Analysis

Low parameter count (effectively 3 active) and a mostly-flat sensitivity surface on trend_ma, target_vol, vol_lookback, min_exposure, min_notional (no cliffs there).

Analysis

PBO is acceptable (0.3069) and the base config's full-period Sharpe (3.18) is genuinely positive in-sample.

Analysis

Failed deflated Sharpe decisively: DSR=0.0003, optimized Sharpe 4.2 far below the expected-max luck bar 11.97 over 225 trials, is_significant=false, sharpe_ci_low 0.0888 (pinned at 0).

Analysis

Holdout FAILED (0.0, ratio 0); walk-forward is_overfitted=TRUE with avg IS 12.74 collapsing to avg OOS 0.0 across ALL three windows.

Analysis

The all-zero OOS is a sizing-bound artifact: the optimizer selected cash_buffer=1.127 and explores max_exposure>1.0, both of which push order notional above available cash on a no-leverage CASH spot account (sensitivity heatmap confirms Sharpe→0 in exactly those regions — the two flagged cliffs). The optimization is therefore partly invalid.

Analysis

Even the clean base config is not promotable: max_drawdown 62.8% refutes the central tail-safe/de-risk-in-vol-spikes thesis, and information_ratio is NEGATIVE (-0.386) with benchmark_meaningful=TRUE, so it does not beat simply holding BTC (534% total return is far below BTC buy-hold over the same ~9 years).

Analysis

Suspected metric artifact: several daily_returns are physically impossible for a no-leverage spot long (+84%, +129% single days) and annualized_volatility 392% is inconsistent with CAGR 27% — flagged for harness review, mechanism not independently verified.

Analysis

The backtest is functionally broken, not low-edge: only 4 trades over 2017-2026 with metrics_reliable=false, and ZERO activity after Nov 2019 even though BTC spent long stretches of 2020-2021 and 2023-2025 above its 200-day MA. Fix the strategy so it actually holds and rebalances BTC across the whole sample before any optimization. Specific fixes: (1) Resolve the contradictory use of get_account_equity(). It is used as TOTAL equity in position_size/entry ('equity == total value') but as remaining-USDT CASH in should_exit ('CASH account -> remaining USDT only', total = cash + cur_notional). Pick one definition and reconstruct total portfolio value (cash + held BTC notional) consistently everywhere; on a CASH account after deploying ~95% to BTC, cash~0, so the current code collapses 'total' and freezes all subsequent rebalances and re-entries. (2) Do not mix manual _submit_rebalance market orders inside should_exit with the base template's own entry/exit order management — either route ALL sizing/rebalancing through the template hooks or fully own order management, not both, to avoid double-managing the position and corrupting cash/position state. (3) Explicitly verify the strategy re-enters after exiting to cash: when price crosses back above the 200-day MA following a trend-break exit, should_enter must fire BUY again — add a flat-state path and test it. (4) After the fix, confirm the equity curve shows continuous long/flat participation through 2020-2025 (it should look like a de-risked BTC buy-hold), then re-submit for backtest review. The concept (trend gate + vol management, tail-safe BTC spot) is sound and worth pursuing once the accounting bug is fixed.

Outcome Summary

Deliberately designed as the antithesis of the session's blow-ups — long-only, no leverage, single-instrument BTC spot with a 200-day trend gate and inverse-vol scaling — this strategy was the rare book that cleared the backtest-review gate and earned a full optimization run. There the case unraveled: deflated Sharpe came in at 0.0003 against a best-of-225-trials luck bar of 11.97, the holdout scored zero, and the walk-forward's ~12.7 in-sample Sharpe collapsed to 0.0 out-of-sample across all three windows (partly a sizing-bound code artifact where the optimizer chose cash_buffer>1 and max_exposure>1 on a cash account, producing non-trading configs and two cliffs). Even the clean base config was unpromotable: a negative information ratio meant it underperformed simply holding BTC, and a 62.8% drawdown directly contradicted its 'tail-safe / de-risk into vol spikes' premise. After two iterations the analyst abandoned it, concluding the long/flat single-asset trend expression is BTC beta rather than a deflation-surviving edge.

Outcome Summary

A single-asset long/flat trend book on a major is essentially that asset's beta — its high in-sample Sharpe is inflated by bull-market exposure loading and cannot survive deflation or beat buy-and-hold, no matter how carefully the vol-targeting and venue routing are constructed.

Outcome Summary

The strategy passed the pre-optimization backtest-review gate ('optimize') but the analyst issued an 'abandon' verdict after the full 3-phase optimization, because it failed deflated Sharpe, holdout, and walk-forward decisively, showed a negative information ratio versus BTC buy-and-hold, and a 62.8% drawdown that refuted its central tail-safe thesis.

Outcome Summary

A long/flat, single-instrument, no-leverage BTCUSDT.BINANCE_SPOT daily strategy combining a 200-day trend gate (hold only above the moving average, else cash) with Moreira-Muir inverse-realized-volatility exposure scaling, intended to be tail-safe by construction and express the factory's one validated trend edge on its cleanest trender.

Outcome Summary

Over ~9 years and 63 long-only trades it returned 534% (profit factor 1.56, 35% win rate, headline Sharpe 3.18 but with CI straddling zero), yet carried a 62.8% max drawdown over a 1,102-day stretch and a negative information ratio (-0.386), trailing BTC buy-and-hold. In optimization it failed every robustness gate: deflated Sharpe 0.0003 (vs 0.95 bar), holdout 0.0, and walk-forward overfitted with in-sample Sharpe ~12.7 collapsing to 0.0 OOS across all three windows.
Strategy report

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