Skip to content

View original

AvaxPremiumIndexDislocationReversalLS

Hypotheses

AVAX USD-M Perp Premium-Index Dislocation Reversal, Long-Short (Single Instrument AVAXUSDT.BINANCE Perp, 4h Bars, Fade Price ONLY When the Perp's Mark-vs-Index PREMIUM Hits a Leverage-Crowding Extreme AND Price Is Stretched, Revert-to-Mean Exit, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument reversal on AVAXUSDT.BINANCE (USD-M perp, 4h bars) whose trigger is the PREMIUM INDEX — the perpetual's mark price relative to the underlying spot index (catalogued multi-year via Binance premium/mark/index klines). A large positive premium means leveraged longs are aggressively lifting the perp ABOVE fair spot value (crowded, fragile); a large negative premium means leveraged shorts are pressing the perp BELOW spot. Unlike the 8h funding coupon, the premium index is a fast, continuously-observable thermometer of perp-vs-spot leverage imbalance. The strategy fades price ONLY when this basis dislocation is at a rolling extreme AND price itself is stretched from its mean — the joint condition that flags a genuine leverage-driven overextension likely to snap back. This is deliberately NOT any dead/in-pipeline family: NOT funding-carry (no coupon harvested, no delta-neutral hedge — it is a directional single-leg reversion; L33 does not apply), NOT the L/S-account-ratio positioning fade (different feed — price basis, not account counts), NOT the OI-surge/deleveraging ideas already in pipeline (different feed — mark-vs-index basis), NOT liquidation-feed dependent (uses multi-year premium klines, sidestepping the 90-day liquidations wall), NOT breakout/trend momentum, and NOT a plain price-z mean-reversion (the fade is GATED on the basis dislocation, not price alone). It fills the under-represented long-short bucket (14% vs quota) with a rarely-used catalogued feed.

Hypotheses

The previous iteration misdiagnosed the zero-trade failure as too-tight thresholds and loosened them 1.5 -> 1.0, which changed nothing because the thresholds were never evaluated. I traced the real cause: z_prem was permanently None. 'premium_index' is not in PipelineProcessor.SUPP_KEYS, so Layer 3 never loads the real series and falls back to synthetic_scenarios._gen_synthetic_premium_index, which emits bars[::60] — one print per 60 bars, i.e. one per 10 DAYS on a 4h clock. The code sampled premium once per bar, discarded prints older than 8h, and then required >= max(3, 0.3*L) = 9 samples inside a 30-bar window; at 10-day spacing at most one or two bars per window can carry a fresh print, so that requirement was unsatisfiable by construction and the mandatory basis gate could never fire. The real feed is the opposite of sparse: data/supplementary/premiumIndexKlines/AVAXUSDT holds 2,615,268 rows at 1-minute spacing, and sampling it at bar cadence with the 8h cap gives a fresh premium on 12,619 of 13,025 bars with the joint gate firing 1,666 times at z=1.0, 497 at 1.5 and 137 at 2.0. So the mechanism works on real data and only the sandbox stand-in was too coarse to express it. The fix is minimal and preserves real-data semantics exactly: the staleness tolerance is now max(prem_staleness_hours, stale_gap_mult x the feed's own median inter-print gap), computed once at parse time. On the real 1-minute feed the median gap is ~60s so the tolerance stays 8h and behaviour is identical to the measurements above; on a sparse synthetic feed it widens so the last print carries forward and the z-score computes, letting Layer 3 actually exercise the gate. I also restored the thresholds to 1.5 — the 'rolling extreme' the hypothesis specifies — since 1.0 was a fix for a problem that did not exist, and 1.5 still yields 497 signal bars on real data. The basis gate remains mandatory with no price-only fallback, imports are unchanged, the continuous -z_price signal and the exit/stop/sizing logic are untouched, and _param_bounds now mirrors every clamp.

Hypotheses

Negative-expectancy single-perp premium-index-gated reversion — not worth 2 hours of optimization. Over 280 trades in 6 years the fade loses net of costs: avg_trade_return_pct -0.674% (negative), profit_factor 0.76, expectancy -$93/trade with avg_loss ($828) > avg_win ($544), total_return -29% (CAGR -5.1%), and it loses in 2021 (-10.8%), 2022 (-6.1%), 2023 (-1.0%), 2024 (-11.3%) and 2025 (-6.6%) — only partial 2026 is positive. It is decisively bad on risk-adjusted terms (Sharpe -0.58, CI [-1.43, 0.23], PSR 0.180, 35.9% drawdown to 54% CI, negative Sharpe in all three vol terciles). The premium-index feed is correctly wired and dense (the iteration-2 fix worked), so this is not a data/code defect — the mechanism simply has no edge: fading price at joint premium+price z-extremes on a single alt gets adversely selected and bleeds, exactly the L73 single-perp supplementary-gated + L55 single-name reversion families (both zero survivors). No tuning of the z-thresholds converts a fade that loses in every regime into an edge. Failure pattern: no_edge/fee_edge single-perp premium-gated reversion, negative per-trade and negative nearly every year (L73/L55).

Implementation

Long-short contrarian reversion on AVAXUSDT.BINANCE USD-M perpetual, 4-hour bars, gated on the perp's mark-vs-index PREMIUM. Each bar computes a z-score of the premium-index series (sampled at bar cadence over the last zscore_lookback bars) and a z-score of price over the same window. The strategy fades only when BOTH are at an extreme in the same direction: premium z >= +1.5 with price z >= +1.5 means leveraged longs have lifted the perp above fair spot value while price is stretched high, so it SHORTS; the mirror condition LONGS a perp pressed below spot by crowded shorts. Positions exit on reversion of price z back through zero, a hard ATR stop at stop_atr x ATR beyond entry, or an 18-bar (~3 day) time cap. Sizing risks 1% of equity across the ATR stop with gross capped at 0.5x equity, leverage 1.0. If no premium series is available the strategy does not trade — the basis gate is the edge, with no price-only fallback.

Verification Results

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: AVAXUSDT.BINANCE-4-HOUR-LAST-EXTERNAL, Bars processed: 13025 Diagnostics: should_enter() returned a side 0 times over 12980 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds. Ensure your strategy produces trades with the given data and parameters.

Verification Results

Snapshot the stop_level into a dedicated pending-entry field inside should_enter() rather than reading the mutable _last_trap in _track_position().

Verification Results

Stop-level anchoring is imprecise across the entry boundary. _last_trap (side + stop_level) is recomputed from the current bar's close whenever a fresh extreme signal fires, and _track_position captures it only on the first bar the position becomes visible. If a new same-direction extreme fires on that bar, the captured entry_stop is anchored to the later bar's price rather than the true entry bar. In practice a fresh extreme rarely re-fires right after entry (price hasn't reverted yet), so the entry-bar stop is almost always retained, but the coupling is fragile.

Backtest Review

Genuinely orthogonal premium-index feed correctly wired (dense 1-min series, adaptive staleness), clean single-instrument construction, adequate sample (280 trades)

Backtest Review

Negative expectancy: avg_trade_return_pct -0.674% (negative), profit_factor 0.76, expectancy -$93/trade, avg_loss ($828) > avg_win ($544)

Backtest Review

Loses in nearly every year: total_return -29%, CAGR -5.1%, annual returns negative 2021 (-10.8%), 2022 (-6.1%), 2023 (-1.0%), 2024 (-11.3%), 2025 (-6.6%) — only partial 2026 (+7.8%) positive

Backtest Review

Decisively insignificant/bad: Sharpe -0.58 (CI [-1.43, 0.23]), PSR 0.180, max_drawdown 35.9% (CI to 54%), negative Sharpe in all three vol terciles

Backtest Review

L73 single-perp supplementary-gated directional + L55 single-name reversion — both zero-survivor families; the premium-index gate does not rescue a fade that loses to costs and adverse selection

Iteration History

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['exit_z', 'stop_atr', 'atr_period', 'min_notional', 'max_hold_bars', 'prem_z_thresh', 'price_z_thresh', 'risk_per_trade', 'zscore_lookback', 'max_notional_mult', 'prem_staleness_hours'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: AvaxPremiumIndexDislocationReversalLS._zscore() takes 1 positional argument but 2 were given (bar timestamp: 1735692300000) - steady_downtrend: TypeError: AvaxPremiumIndexDislocationReversalLS._zscore() takes 1 positional argument but 2 were given (bar timestamp: 1735692300000) - flat_ranging: TypeError: AvaxPremiumIndexDislocationReversalLS._zscore() takes 1 positional argument but 2 were given (bar timestamp: 1735692300000) - volatility_spike: TypeError: AvaxPremiumIndexDislocationReversalLS._zscore() takes 1 positional argument but 2 were given (bar timestamp: 1735692300000) - zero_volume: TypeError: AvaxPremiumIndexDislocationReversalLS._zscore() takes 1 positional argument but 2 were given (bar timestamp: 1735692300000) - price_gap: TypeError: AvaxPremiumIndexDislocationReversalLS._zscore() takes 1 positional argument but 2 were given (bar timestamp: 1735692300000)

Iteration History

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: AVAXUSDT.BINANCE-4-HOUR-LAST-EXTERNAL, Bars processed: 2182 Diagnostics: should_enter() returned a side 0 times over 2137 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds. Ensure your strategy produces trades with the given data and parameters.
Strategy report

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