DogeSpotPerpBasisDislocationConvergenceNeutral15m
Hypotheses
DOGE Spot-Perp Basis Dislocation Convergence, Market-Neutral (Cross-Venue BINANCE_SPOT Long + BINANCE USD-M Perp Short, 15m Bars, Fade LARGE Retail-Squeeze Perp Premiums, Funding-Tailwind, Pure-OHLCV Low-Parameter)
Hypotheses
A MARKET-NEUTRAL, CROSS-VENUE convergence trade on the SAME underlying across TWO Binance venues: LONG DOGEUSDT.BINANCE_SPOT (spot, cash leg) + SHORT DOGEUSDT.BINANCE (USD-M perpetual, hedge leg), entered only when the PERP trades at a LARGE premium to SPOT. This fills four under-weight buckets at once: cross_venue (6.5% vs >=15% target), BINANCE_SPOT (10.5% vs >=15%), long_short/market-neutral direction (long_only is 84.1% vs a <=55% cap), and short_1m_15m horizon (4.5% vs >=10%) by running on 15m bars. CRITICALLY, this is NOT the CM-vs-USD-M funding-differential trade that previously failed: that one chased a ~1e-6-per-8h FUNDING spread between two tightly-coupled perps and was mathematically incapable of clearing fees. This trade targets an outright PRICE dislocation between spot and perp that on a retail-squeeze-prone, high-beta name like DOGE routinely blows out to 60-200+ bps during leverage-driven melt-ups — one to two ORDERS OF MAGNITUDE above the ~0.30% combined round-trip cost (spot ~0.20% RT + perp ~0.10% RT). DOGE is chosen deliberately over BTC/ETH: majors' spot-perp basis is arbitraged to a few bps and would be sub-cost, whereas DOGE is the most retail-leverage-driven deep-liquidity pair on Binance, so its perp regularly detaches from spot during squeezes. Design is intentionally MINIMAL and pure-OHLCV (basis computed from two aligned 15m bar closes) — no funding-series scan, no L/S-ratio census, no options chain — which structurally avoids BOTH recurring failure modes in this portfolio: the short-history data wall (both DOGE spot and perp have multi-year 15m Binance history) and the Layer-3 300s timeout (per-bar work is O(1): one subtraction and one ratio, no re-scanning of any supplementary series). Only 4 tunable knobs to resist the deflated-Sharpe/overfitting rejections.
Hypotheses
Iteration-5 fix for the Layer-3 zero-trade failure, made minimal and evidence-based. Layers 1/1.5/2 already passed and are untouched (same imports, class, two-leg structure, alignment-safe contemporaneous reads). The only functional change is the ENTRY GATE UNIT: iteration 4 de-meaned the basis correctly but still thresholded it in absolute bps. Measuring the 10,176 aligned 15m closes the catalog actually holds (DOGE spot 15m starts 2026-05-07): raw basis mean -5.00 bps, sd 1.95, max +16.98; the de-meaned series has sd 1.54 bps, so the configured absolute gate fires ONCE in 119 days and zero times in the sandbox window -- exactly the reported '0 sides over 10176 evaluated bars'. Gating on the rolling z-score of the same deviation (scale-invariant, per the recurring lesson to use z-scores rather than fixed constants) fires 165 times. I reproduced the sandbox locally with BacktestRunner on the 208-day 15m window: the previous code was inert, this code produces 356 trades (178 pairs), no errors, ~2 min wall clock (inside the 300 s budget). One caveat I owe you: the same local run shows the hypothesis's premise is absent from the data -- avg_trade_return_pct is 0.013% against a ~0.30% combined spot+perp round trip, total return -34%, Sharpe -1.0. The dislocation this trade is supposed to fade is ~1.5 bps of dispersion, roughly 20x smaller than the fee it must clear, and the claimed '60-200+ bps' DOGE spot-perp blowouts do not occur in the available history (single +17 bps tail). The code is now correct and measurable; the mechanism is not viable, which is why my recommendation is abandon rather than another tuning loop.
Hypotheses
Negative expectancy on a reliable 360-trade sample with the core premise measurably absent. The hypothesis depends on '60-200+ bps' DOGE perp-over-spot dislocations, but on the only overlapping 15m spot history (from 2026-05-07) the basis has ~1.5 bps dispersion and a lone +17 bps tail — 10-20x below the ~0.30% combined spot+perp round-trip. Result: avg_trade_return_pct 0.013% (near zero, far below the fee floor), profit_factor 0.055, total_return -34.7%, Sharpe -1.08 (CI fully negative), commission 518% of gross, and an adverse R:R (avg_loss 312 vs avg_win 32, skew -8.9). The z-score gate fires on ~3 bps relative deviations that cannot clear costs, so there is no positive gross edge for optimization to tune toward — the 4 knobs (entry_z/exit_z/basis_window/max_hold_bars) have no region that turns a PF-0.055 signal positive. QA's fee-nonviability concern is confirmed on full history. Not worth 2 hours of optimization. abandon_class=negative_expectancy (premise falsified: the large-dislocation edge does not exist in the data).
Implementation
Market-neutral cross-venue convergence pair on DOGE: LONG DOGEUSDT.BINANCE_SPOT + dollar-matched SHORT DOGEUSDT.BINANCE USD-M perp on 15m bars, opened when the perp-over-spot basis (bps) is rich versus its own 24h rolling regime (z >= entry_z) and closed on reversion (z <= exit_z) or a 24h timeout. Pure OHLCV, O(window) per bar, four tunables. Naked legs are flattened immediately so the book is never directionally exposed.
Verification Results
Acceptable as a mean-reverting basis-convergence implementation. If strict fidelity to the 'perp premium' wording is required, add a floor requiring basis>0 (perp actually rich) in addition to the z-gate; but note the data shows this almost never occurs, which is itself the edge finding.
Verification Results
The hypothesis specifies entering 'only when the PERP trades at a LARGE premium to SPOT' (absolute perp premium, claimed 60-200+ bps). The code instead gates on a rolling z-score of the basis vs its own recent mean. Given the measured ~-5 bps structural basis offset, a z>=entry_z entry can trigger while the perp is at a small discount to spot, not a premium. This is a reasonable, scale-invariant convergence gate and still fades basis dislocation, but it is a relative-regime deviation rather than the absolute-premium edge the hypothesis literally names.
Verification Results
Carried as edge_concern for the analyst. No code change makes a 1.5 bps dislocation clear a 30 bps fee; the honest outcome is likely abandon at backtest_review.
Verification Results
Per-trade edge (~1.5 bps dispersion) is roughly 20x below the ~30 bps combined spot+perp round-trip cost; 356 trades in the sandbox confirm negative expectancy. Advisory only — this is a performance result decided at backtest, not a code defect.
Verification Results
Fee-nonviable on available history, per the developer's own honest measurement. The perp-over-spot basis on the only overlapping DOGE spot 15m data (from 2026-05-07) shows ~1.5 bps of dispersion with a single +17 bps tail — the hypothesis's premised '60-200+ bps' retail-squeeze dislocations are absent by a factor of 10-20x. Against a ~30 bps combined round-trip (spot ~0.20% + perp ~0.10%) the entire signal is ~20x smaller than the cost: sandbox avg_trade_return_pct 0.013% (well below the 0.15% floor), total_return -34.4%, PF 0.047, Sharpe -3.4, commission 601% of gross. Also note a mechanism nuance for the analyst: the entry gate is a z-score of the basis vs its own rolling mean, and because the basis carries a persistent ~-5 bps offset, a z>=2 entry can fire while the perp is still at a small DISCOUNT to spot rather than the 'large premium' the hypothesis names — so this fades relative regime deviation, not an absolute perp premium. This is a legitimate spread-convergence mechanic but not the large-dislocation edge originally claimed. All of this is a performance/edge judgement for the backtest+analyst, not a code defect; the developer recommends abandon on these grounds.
Backtest Review
Reliable, measured terminal result: 360 trades over the ~120-day spot-perp overlap, both legs read from contemporaneous bars (no stale-leg artifact), so this is a genuine test of the mechanism rather than a zero-trade or data-wall stall.
Backtest Review
Market-neutral construction is sound and the code is O(1) per bar.
Backtest Review
Premise falsified: the hypothesized '60-200+ bps' DOGE spot-perp dislocations do not exist in the only overlapping 15m data — basis dispersion is ~1.5 bps with a single +17 bps tail, 10-20x smaller than the ~0.30% combined round-trip cost.
Backtest Review
Negative expectancy on a reliable sample: avg_trade_return_pct 0.013% (well below the 0.15%/0.25% floor and near zero), profit_factor 0.055, total_return -34.7%, Sharpe -1.08 (CI [-3.23, -1.00], entirely negative), expectancy -$193/trade.
Backtest Review
commission_pct_of_gross 517.9% and total_impact 50k+ — fees/impact dwarf the tiny gross edge; z-score gate fires on ~3 bps relative deviations that cannot clear cost.
Backtest Review
Structural R:R adverse: avg_loss 312 vs avg_win 32, return_skew -8.9, kurtosis 81 — a few large convergence-failure losses erase the many tiny wins.
Backtest Review
Only ~120 days of usable spot 15m history; the perp's 6-year history is irrelevant since the spot leg gates every bar.
Analysis
Code↔hypothesis misalignment found by the semantic auditor — the code does NOT implement the hypothesis. Re-code the strategy to implement the hypothesis EXACTLY (instrument, timeframe, direction, the named edge/mechanic, sizing). Concrete issues: Entry condition contradicts the hypothesis's stated trigger. The hypothesis title/body specify entering ONLY when the perp trades at a LARGE absolute premium to spot (60-200+ bps, cited as one-to-two orders of magnitude above the ~30 bps round-trip cost). The code has no absolute-premium gate anywhere: `calculate_signal` computes `basis = (perp_px - spot_px)/spot_px*1e4`, then `dev = basis - self._basis_sum/n` (rolling mean over basis_window=96 bars), and `_manage` opens the long-spot/short-perp pair on the sole condition `dev >= entry_dev_bps` (default 2.5, bounds [1.0, 6.0]); there is no check that `basis > 0`. The base-template entry path is inert here (`should_enter` returns None, `position_size` returns 0), so `_manage` is the only entry gate. Per the strategy's own measured distribution (mean -5.31 bps, max +0.00 bps, 0.00% of bars beyond |20| bps), the perp is never at a premium in this data, so every entry fires while the perp is at an outright DISCOUNT to spot — the opposite sign to the hypothesis's condition — and at a ~2.5 bps trigger magnitude 24-80x below the 60-200+ bps dislocation that is the hypothesis's entire cost-clearing rationale. The 512 trades / PF 0.066 / -50% result corroborates that entries fire under the substituted mechanism rather than the hypothesized one.
Iteration History
Verification failed (Layer 2 — synthetic scenarios):
Parameters used: ['exit_bps', 'min_bars', 'entry_bps', 'capital_frac', 'min_notional', 'max_hold_bars', 'qty_precision', 'spot_instrument_id', 'supplementary_data']
Check that __init__ sets all attributes from self.parameters.get().
- steady_uptrend: TypeError: DogeSpotPerpBasisDislocationConvergenceNeutral15m._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735690740000)
- steady_downtrend: TypeError: DogeSpotPerpBasisDislocationConvergenceNeutral15m._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735690740000)
- flat_ranging: TypeError: DogeSpotPerpBasisDislocationConvergenceNeutral15m._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735690740000)
- volatility_spike: TypeError: DogeSpotPerpBasisDislocationConvergenceNeutral15m._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735690740000)
- zero_volume: TypeError: DogeSpotPerpBasisDislocationConvergenceNeutral15m._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735690740000)
- price_gap: TypeError: DogeSpotPerpBasisDislocationConvergenceNeutral15m._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735690740000)
Iteration History
Verification failed (Layer 3 — sandbox backtest): No trades produced
Bar type used: DOGEUSDT.BINANCE-15-MINUTE-LAST-EXTERNAL, Bars processed: 210972
Diagnostics: should_enter() returned a side 0 times over 3168 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds.
Ensure your strategy produces trades with the given data and parameters.
Iteration History
Verification failed (Layer 4 — QA review) [class=code_defect]:
- [edge_concern] Developer's own full-overlap measurement (10,176 aligned 15m closes, 2026-05-07..2026-09-03) shows the perp-over-spot basis max is +17 bps and 99th pctile ~2 bps, against a ~30 bps two-leg round trip (spot 0.10%x2 + perp 0.05%x2). The hypothesis's premise of 60-200+ bps DOGE spot-perp dislocations is absent by a factor of 4-10; funding tailwind (~0.9 bps/day) needs ~33 days to cover one round trip vs a 24h convergence horizon. Also relevant to the analyst: the spot leg's 15m history only begins 2026-05-07, so the pair is only ever measurable over a ~120-day overlap.
- [critical] Fee-viability failure by construction on a two-leg trade. The entry dislocation floor min_dev_bps=5.0 (0.05%) is below the 0.15% viability floor, and the trade pays a ~0.30% two-leg round trip (BINANCE_SPOT 0.10%/side x2 + BINANCE perp 0.05%/side x2). A convergence trade's gross capture is bounded by the entry dislocation, so at a 5 bps entry the best-case perfect convergence (~5 bps) recovers only ~1/6 of the 30 bps cost. The developer's measurement over the entire 10,176-bar overlap confirms the LARGEST dislocation ever observed is 17 bps and the 99th pctile is ~2 bps, both below the 30 bps cost, and the shipped-gate replay gives mean gross capture 8.1 bps => ~-22 bps net per trade. This is fee-negative regardless of parameterization (raising the threshold toward the 30 bps needed drives trades to zero, since no observed move reaches it), so it cannot be rescued by the optimizer and should be rejected here rather than in a full backtest. (line 96) — fix: The convergence mechanism cannot clear the two-venue round-trip cost on DOGE spot-vs-perp basis, which structurally never exceeds ~17 bps. No parameter change fixes this. Abandon this mechanism, or reframe onto a venue/instrument pair whose basis dislocations routinely exceed ~40-60 bps (i.e. clear the 30 bps two-leg cost with margin).
Iteration History
Verification failed (Layer 3 — sandbox backtest): No trades produced
Bar type used: DOGEUSDT.BINANCE-15-MINUTE-LAST-EXTERNAL, Bars processed: 211068
Diagnostics: should_enter() returned a side 0 times over 3264 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds.
Ensure your strategy produces trades with the given data and parameters.
Iteration History
Verification failed (Layer 4 — QA review):
- The hypothesis's premise is empirically falsified, measured by the developer on the real 7,584 aligned 15m closes (2026-05-07..2026-08-06): the DOGE perp-vs-spot basis is mean -5.31 bps, sd 1.54, min -10.70, MAX +0.00 bps -- the perp NEVER trades above spot, so the specified 'fade a perp premium >= 8 bps' gate cannot fire at any threshold (the sign is wrong, not the level). The identical ~-5 bps offset appears on BTC (mean -4.57) and ETH (mean -4.75), identifying it as a systematic FEED ARTIFACT of how the two venues' 15m closes are recorded, not an economic basis. The hypothesis's central claim of 'routine 60-200+ bps DOGE dislocations' is absent from the data by a factor of 10-20 (0.00% of bars exceed 20 bps). To produce any trades at all the developer re-based the gate onto basis-minus-rolling-mean, leaving a residual dislocation of only ~1.5 bps of standard deviation.
- Fee/edge failure that is catastrophic, not marginal (checklist #7, L6). A two-leg cross-venue round trip is four fills ~ 30 bps (spot 0.20% + perp 0.10%) against a ~1.5 bps residual signal -- the fee is ~20x the entire edge. The corrected-engine sandbox is far worse than break-even: total_return -38.07%, Sharpe -1.99, profit_factor 0.059, win_rate 0.35 with avg_loss $324 vs avg_win $36 (~9x), largest_loss -$2,273, return_skew -13.9, return_kurtosis 243, turnover 102x, total_impact_usd $55,829 over 382 trades. Fading a 1.5-bps noise deviation at 15m and holding divergence losers to the 24h timeout yields asymmetric-negative geometry on a book that is delta-neutral to DOGE direction but NOT to the basis it trades.
- Measurability / data-span wall. DOGEUSDT.BINANCE_SPOT has only ~7,680 15m bars (~92 days, 2026-05-07..2026-08-07) versus the perp's 212,988 bars back to 2020-07, so the base's same-timeframe alignment barrier can evaluate the pair over only that ~92-day overlap (3,264 of 211,068 processed bars in the failure message). Even ignoring the fee verdict, a ~92-day window cannot populate walk-forward OOS windows or a 15-day holdout for a mean-reversion pair. The developer states extending the spot history is a data-layer task, not strategy code.
Iteration History
Verification failed (Layer 3 — sandbox backtest): No trades produced
Bar type used: DOGEUSDT.BINANCE-15-MINUTE-LAST-EXTERNAL, Bars processed: 19756
Diagnostics: should_enter() returned a side 0 times over 10176 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds.
Ensure your strategy produces trades with the given data and parameters.
Backtest and paper results are hypothetical. Trading involves risk of loss.