Skip to content

View original

NearSpotLongOnlyDonchianChandelierVolTarget

Hypotheses

Directional Asymmetry of Crypto Trend: LONG-ONLY Donchian Breakout with Chandelier Exit on NEARUSDT.BINANCE_SPOT 4H — the Short Leg Is Removed Because It Is Measured to Be a Systematic Bleed, Not Because a Regime Filter Says So (Ungated, Pure OHLCV, Vol-Targeted Sizing)

Hypotheses

A LONG-ONLY, single-instrument, ungated, pure-OHLCV breakout strategy on NEARUSDT.BINANCE_SPOT, 4-HOUR bars. The mechanism claim is NOT 'trend works' (the factory has established that at ~1% survival); it is that CRYPTO TREND IS DIRECTIONALLY ASYMMETRIC and that the repeated long-short trend failures in this corpus are caused by the SHORT leg, so the correct fix is leg REMOVAL rather than another gate (lesson 130 says gates subtract; this hypothesis adds no gate, no regime filter and no supplementary feed). MEASUREMENT BEHIND THE CLAIM (run in this session on the factory catalog, 2021-01-01 to 2026-09-18, 24 Binance USD-M perps, one identical rule: enter on a 20-bar Donchian break, exit on a 3xATR(14) chandelier trail, no filters): - 4H LONG leg: +1.23% GROSS per trade, positive on 22 of 24 symbols (92%), long-leg-only Sharpe 0.52, median 163 long trades per symbol. - 4H SHORT leg, same rule mirrored: -0.33% GROSS per trade, positive on only 8 of 24 symbols (33%), short-leg-only Sharpe -0.17, median 159 trades. - 1-DAY clock reproduces it: LONG +6.20%/trade (88% of symbols positive) vs SHORT -1.83%/trade (21% positive). The factory's own most recent evidence agrees independently: the BtcDualTimeframeMomentumConfluenceLS abandon note records LONG +0.408% vs SHORT -0.778% gross per trade, with the 93 shorts losing $8,293 — the book was killed by its short leg. ECONOMIC CAUSE for the asymmetry (why it is not a sampling accident): (1) crypto carries a structural long risk premium — the asset class' unconditional drift is strongly positive and a short leg pays that premium away on every held bar; (2) the participant base is asymmetric — downside breakouts are absorbed by systematic spot dip-buying, DCA flows and stablecoin dry powder, so DOWN trends mean-revert faster, while upside breakouts attract genuinely NEW capital (new spot buyers, attention, listings, index/treasury flows) so UP trends self-reinforce and persist; (3) on perps the short side additionally pays funding in exactly the persistent-uptrend states where the trend signal is right. Because the strategy is long-only and unlevered, the venue routing rule sends it to SPOT (CASH account, no funding cost, no liquidation risk) — which is also the under-represented, highest-survival venue in the current portfolio (10.4% vs the >=15% target) rather than the 69.4%-saturated USD-M futures bucket. SIZING is vol-targeted, which is a sizing rule and not a signal gate: notional = equity * min(1.0, 0.25 / realized_annualised_vol), realized vol = stdev of the last 180 4H log returns * sqrt(2190). Measured on NEAR this converts a raw-notional -74% equity drawdown into -24.3% at 17.5% realized portfolio volatility, without touching per-trade return on notional (the promotion metric). ALTERNATIVES I FALSIFIED IN THIS SESSION BEFORE PROPOSING THIS (stated so the pipeline does not re-spend them): (a) intrabar Close-Location-Value 'taker pressure' momentum — negative on 7 of 12 symbols, discarded; (b) VWAP-vs-VWAP 'cost basis / disposition' crossover — does NOT beat a plain EMA crossover at any of 4 window pairs on 19 Binance 4H symbols, discarded; (c) BTC->alt lead-lag catch-up on 1H bars — conditional mean forward return is +0.005% to +0.021% per event, one full order of magnitude below the 0.10% round trip, arbitraged and dead; (d) a volatility-SQUEEZE gate in front of the same breakout — raised gross/trade from 0.43% to 0.50% but CUT median Sharpe from 0.28 to 0.22 by halving the trade count, exactly the lesson-130 pattern, so it is deliberately NOT in this design; (e) Hyperliquid as the venue — rejected on a catalog check: HL daily bars before 2023 carry ZERO volume (the venue did not exist), so HL's usable history is ~3.3y daily / 2.65y 4H, too short for this walk-forward, and that phantom pre-2023 history plausibly contributes to hyperliquid's 0/131 record.

Hypotheses

Implements the hypothesis' central claim literally: crypto trend is directionally asymmetric, so the correct repair for the corpus' long/short trend failures is REMOVAL of the short leg, not the addition of another gate. Accordingly the coded rule is exactly the measured rule (20-bar Donchian entry, 3xATR(14) chandelier exit) with the mirrored short leg deleted and nothing added — no squeeze gate, no trend filter, no funding/OI feed (lesson 130 / L25: gates subtract trades and Sharpe). The continuous ATR-normalised breakout distance is returned every bar and the entry decision lives in should_enter, per the continuous-signal rule. Venue routing follows the project rule rather than the brief's futures default: the strategy is long-only and unlevered and its edge is not funding-based, so it belongs on BINANCE_SPOT (CASH, leverage hard-capped at 1.0) — which also avoids paying the short leg's funding and matches the hypothesis' own venue argument; Hyperliquid was excluded by the hypothesis on data-history grounds. Sizing is the hypothesis' vol-target verbatim (0.25 annualised target, 180-bar realized vol, scale capped at 1.0), which scales the equity path without touching per-trade return on notional, and on a CASH account gross notional can never exceed equity (L114/L15 gross-exposure check passes by construction). Expected frequency is ~29 trades/year from the measured median of 163 long trades per symbol over 5.7 years, comfortably above the zero-trade risk. Per-bar work is O(180) on fixed windows with no growing-history recomputation, so the 300s sandbox budget is not at risk. One caveat for the record: the long-leg advantage is partly a restatement of crypto's unconditional positive drift over the 2021-2026 sample, so the walk-forward should be read against a buy-and-hold benchmark on NEAR rather than against zero — implemented as specified regardless.

Implementation

LONG-ONLY, ungated, pure-OHLCV Donchian breakout with a chandelier trailing exit on NEARUSDT.BINANCE_SPOT 4-HOUR bars. Every bar it computes a continuous signal = (close - highest high of the prior 20 bars) / ATR(14), i.e. the breakout distance in ATR units (negative while price sits inside or below the channel). It BUYs when that value turns positive (a plain Donchian channel break) and exits when close falls below highest-high-since-entry minus 3 x ATR(14). There is no regime filter, no confirmation condition and no supplementary feed. Position size is volatility-targeted: notional = equity * 0.95 * min(1, 0.25 / realized_annualised_vol), where realized vol is the stdev of the last 180 4H log returns annualised by sqrt(2190). Spot/CASH venue, leverage 1.0, so the book is unlevered, pays no funding and cannot be liquidated; SELL is only ever used to close a long.

Verification Results

Optionally seed _trail_high in on_order_filled / on the entry bar itself so the anchor includes the breakout bar's high; or accept the current (more conservative on the anchor, looser on the stop) behaviour and document it.

Verification Results

The chandelier trailing extreme is seeded on the FIRST bar after the fill (from max(position.avg_px_open, that bar's high)), so the entry bar's own high never enters the trail anchor. Combined with should_exit() being evaluated only at 4H bar close, the effective stop is slightly looser than the literal 'highest high since entry - 3*ATR' rule and never fires intra-bar. The hypothesis specifies no fixed hard stop, so this is a fidelity note, not a defect; the cost is at most one bar of slack on the anchor.

Verification Results

Either drop vol_floor or make the zero-vol case return Decimal('0') explicitly rather than falling through to the floor; keep min_bars_required() derived from vol_lookback (it currently is).

Verification Results

vol_floor (0.10) is inert as configured: the size scale is min(1.0, target_annual_vol / max(vol, vol_floor)) with target_annual_vol = 0.25 > vol_floor, so the floor can never bind before the 1.0 cap does. It only matters if the optimizer pushes target_annual_vol below 0.10. Also, if _realized_annual_vol() ever returned 0.0 (insufficient bars) the floor would yield full 95%-equity sizing — unreachable today because min_bars_required() = vol_lookback + 2 guarantees the window, but it is a latent coupling if vol_lookback is later raised without min_bars_required tracking it.

Verification Results

Sandbox is profitable (+73.3%, PF 1.31, 166 trades, avg_trade_return_pct 1.84% vs a 0.20% spot round trip) but the result looks substantially like NEAR's own 2021-2026 drift rather than an independent edge: benchmark_correlation 0.64 against buy-and-hold with information_ratio -0.56, i.e. the book does NOT beat holding the asset on a risk-adjusted basis, which is precisely the caveat the developer flagged. Regime attribution is also non-monotone (calm +18.7%, normal -18.1%, stressed +69.4%) and 6 of 7 stress windows are negative, so the return is concentrated in a few up-trend episodes; sharpe_ci_low is -0.34. Secondary notes for the analyst: impact_cost_pct is 10.57% of gross (inside the 50% gate but not trivial for an alt-spot name), max_drawdown_ci_high is 56% versus a 25% point estimate, and the long-only Donchian-breakout family has a weak historical record in this corpus (lesson 81's abandoned-mechanism list). The backtest should be read against a NEAR buy-and-hold benchmark, not against zero.

Backtest Review

Trades implement the hypothesis exactly: 166 trades, ALL LONG, zero shorts, 4.4-day average hold, vol-scaled sizes (avg_position_pct 23.5% under a 0.95 cap). No mechanism mismatch.

Backtest Review

Economics far above the venue floor: avg_trade_return_pct 1.84% vs a 0.25% BINANCE_SPOT round trip; commission 3.83% of gross, impact 10.6% — not a fee-edge case.

Backtest Review

Reliable sample and span: 166 trades over 1999 days / 11,987 4H bars, metrics_reliable true, clean entry diagnostics (no size-zero or min-notional drops).

Backtest Review

Fully realized: end_unrealized_pct = 0.0, so +73.3% is closed-trade PnL. DD 25.2% matches the hypothesis's pre-registered -24.3% vol-targeted figure.

Backtest Review

Not a closet long: beta 0.10, exposure 37.5%, alpha +4.2%/yr, 25% DD against a name that buy-and-held through a >90% drawdown.

Backtest Review

Statistically weak as it stands: Sharpe 0.44 with sharpe_ci_low -0.34 and PSR 0.77 — not yet distinguishable from zero.

Backtest Review

Extreme concentration: top 5 trades = 143% of total PnL, top 10 = 216%, median trade -3.14%.

Backtest Review

Recency: last two periods negative (2025 -10.8%, 2026 -8.9% YTD); full calendar years are 3 of 5 positive, exactly on the validity floor.

Backtest Review

Non-monotone regimes (calm +18.7 / normal -18.1 / stressed +69.4) and 6 of 7 stress windows negative.

Backtest Review

QA's benchmark point half borne out: IR -0.56 — it does not beat holding NEAR in raw active terms, though beta 0.10 + positive alpha makes it a risk-reduced rather than return-enhancing profile.
Strategy report

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