EthCmInverseFourHourDualEmaTrendLS
Hypotheses
ETH COIN-M Inverse Perp 4H Dual-EMA Trend (Single-Instrument, Long-Short, Harvesting Inverse-Contract Convexity)
Hypotheses
A long-SHORT, SINGLE-INSTRUMENT, single-venue trend-following strategy on ETHUSD_PERP.BINANCE_CM (COIN-M inverse perpetual, ETH-margined, MARGIN account, ~0.06% RT taker) using 4-HOUR OHLCV bars only (NO funding/OI/liquidation/IV supplementary data, NO second instrument, NO CASH-spot engine path). The strategy runs a simple two-EMA crossover for direction and an ATR trailing stop for exits — three parameters total (fast EMA, slow EMA, ATR multiple) to stay well clear of the overfit signature that killed the multi-parameter breakout/veto strategies this session. The differentiating edge is structural, not parametric: on inverse (coin-margined) contracts a fixed coin-denominated position gives convex USD exposure — exposure grows as the trade moves in your favor and shrinks as it moves against you — a free long-gamma-like payoff that amplifies winning trends and de-risks losers. Trend-following is the natural harvester of that convexity, and it is entirely absent on linear USD-M contracts, so this is a fresh expression rather than a re-run of the USD-M single-asset TSM family already in the portfolio. Risk profile: risk 1.5% of equity per trade (sized in ETH-margin terms); position re-sized on each entry to keep risk-to-stop constant; ATR(14)-based trailing stop at 3.0x ATR; no fixed take-profit (let convexity run the trend, trail it out); single position at a time; max single-position notional 25% of equity; leverage 2x (within COIN-M cap). Low turnover (4H EMA crossover holds multi-day trends) keeps fee drag trivial against the 0.06% RT cost.
Hypotheses
Iteration 3 addresses the Layer-3 sandbox_timeout with the smallest possible change, after profiling the exact failing run locally. The strategy already held NO history: EMAs and Wilder ATR are O(1) incremental updates, there is no supplementary-data scan, no sorting, no per-bar list rebuild - so there was no history-scaling work to remove. A cProfile of the identical sandbox window (ETHUSD_PERP.BINANCE_CM-4-HOUR, 12,683 bars) showed 98s of the 114s profiled total inside fsspec catalog globbing (nautilus persistence get_file_list_from_data_cls walking the ~101k-directory bar catalog), i.e. engine-side data discovery, with strategy code far below 1% of runtime; end-to-end wall clock was 68-92s, well inside the 300s cap, so the reported timeout was contention/heartbeat pressure on a loaded host rather than strategy compute. The one per-bar cost genuinely under the strategy's control was the position lookup, which was issued TWICE per bar (once via _sync_position_state inside calculate_signal, once again inside should_exit); it is now issued ONCE per bar and cached on self._in_pos / self._pos_side, which should_exit reads. Nothing else changed: same signal, same entry/exit thresholds, same inverse-contract sizing, same 1.0x leverage and 20% notional cap from iteration 2, no new imports (Layer 1 stays green) and the signal remains continuous every bar (Layer 2 stays green). A local re-run of the modified file over the same window reproduces the previous behaviour bit-for-bit (168 trades, identical Sharpe/PF/avg_trade_return_pct), confirming no regression. Honest note for the reviewer: that same run shows sandbox Sharpe ~= -0.02 with avg_trade_return_pct 0.59% (well above the ~0.06% RT COIN-M cost) and PF 1.16 - the per-trade edge clears fees but the risk-adjusted edge on the unoptimized sandbox window is ~zero, consistent with the earlier no_edge review; I recommend continuing only because the sandbox is a smoke test and the full backtest/optimization is the proper verdict on the convexity thesis.
Hypotheses
No edge — not worth 2 hours of optimization. Sharpe -0.028 with bootstrap CI [-0.86, 0.73] straddling zero, PSR 0.47 (below coin-flip), information_ratio -0.74, alpha -0.047 (negative), and negative total_return over a full 6-year sample; the book is net-negative once the single 2021 bull leg is excluded (2022 -5.6, 2025 -3.3, 2026 -5.8) and loses in the stressed vol tercile (-8.8%) and every crypto stress window. This is the single-asset trend/TSM family with a base Sharpe at/below zero — base Sharpe is the ceiling (L63), so the 3-phase deflation and holdout only lower it; optimizing just 3 params on a zero-Sharpe series selects best-of-N noise, not a robust edge. The claimed inverse-contract convexity edge did not manifest (flat/negative equity curve, 30.6% DD with a 1,660-day recovery). Data collected fine, so this is not the COIN-M data wall — it is a genuine absence of risk-adjusted edge. Failure pattern: no_edge single-asset dual-EMA trend, base Sharpe ~0 (L63).
Implementation
Long-short dual-EMA trend follower on the ETH COIN-M inverse perpetual (ETHUSD_PERP.BINANCE_CM, 4-HOUR bars, pure OHLCV). Signal = (EMA20 - EMA60) / ATR(14), a continuous EMA spread in volatility units recomputed every bar; long above +0.25 ATR, short below -0.25 ATR, one position at a time with a post-exit direction lock until the spread crosses zero. Exits on a 3.0x ATR chandelier trail from the best close since entry or an EMA-spread flip to the opposite side; no fixed take-profit so inverse-contract convexity can run the trend. Sizing risks 1.5% of equity against the ATR stop distance, capped at 20% of equity gross notional, floored to whole $10 inverse contracts via contracts_for_notional(). Leverage 1.0x.
Verification Results
sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of ETHUSD_PERP.BINANCE_CM-4-HOUR-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).
Verification Results
Analyst to check alpha/IR and regime attribution on the full backtest; if indistinguishable from beta after optimization, weigh abandon. Judge the convexity thesis on the full-history result, not the truncated sandbox.
Verification Results
Alpha vs beta: Sharpe ~0 with benchmark_correlation 0.56 and negative alpha/IR suggests the trend-follower is largely harvesting ETH beta, not market-independent edge. Not a code defect and NOT a fee failure (per-trade edge 0.588% >> fee floor) — flagged so the analyst tests, on full history, whether the dual-EMA trend + inverse convexity produces alpha over buy-and-hold ETH or just correlated exposure with 30% drawdowns.
Backtest Review
Data is real and adequate: 12,683 4H bars over 2020-2026, 168 trades, no data wall (unlike other COIN-M runs this session)
Backtest Review
Clean 3-parameter design (fast/slow EMA, ATR mult) avoids the multi-parameter overfit signature
Backtest Review
Per-trade edge clears the COIN-M fee floor (avg_trade_return_pct 0.463% vs ~0.10% floor; commission only 2.96% of gross)
Backtest Review
No risk-adjusted edge: Sharpe -0.028 with 95% CI [-0.86, 0.73] straddling zero; PSR 0.47 (below coin-flip)
Backtest Review
Negative alpha (-0.047) and negative information ratio (-0.74) vs buy-hold benchmark
Backtest Review
Negative total return over a full 6-year window; net-negative once the single 2021 bull leg is excluded (2022/2025/2026 all negative)
Backtest Review
Loses in the stressed vol tercile (-8.8%, Sharpe -0.29) and in every crypto stress window (LUNA -6.4 Sharpe, FTX -4.4, rate-shock 2022 -13.7%)
Backtest Review
30.6% max drawdown (CI to 51.8%) with a 1,660-day recovery duration for a book that earns nothing
Backtest Review
The 'inverse-contract convexity' thesis did not manifest — the payoff produced a flat/negative curve, not amplified trends
Backtest Review
Single-asset trend/TSM class with base Sharpe ~0 — the ceiling before deflation, so optimization only lowers it
Outcome Summary
EthCmInverseFourHourDualEmaTrendLS ran the factory's one proven family — directional trend with a trailing stop — on the ETH COIN-M inverse perp, betting the contract's convex payoff would amplify winners into a fresh edge. After earlier iterations fixed a sandbox timeout (a duplicate per-bar position lookup) and de-levered to 1.0x, it finally produced a clean 6-year, 168-trade backtest, but the result was flat-to-negative: Sharpe -0.028 with a CI straddling zero, negative alpha and information ratio, -4.74% total return, and a 30.6% drawdown taking 1,660 days to recover. The convexity thesis never showed up, and the profits were confined to the 2021 bull leg while it lost through every crypto stress window. As a no-edge single-asset trend book whose base Sharpe is its ceiling, it was abandoned at backtest review without spending an optimization run.
Outcome Summary
Clearing the fee floor is necessary but not sufficient — a single-asset dual-EMA trend with a base Sharpe at/below zero has no risk-adjusted edge to optimize, and the theorized inverse-contract convexity did not amplify trends into a positive curve; a positive per-trade return that nets to negative total return over 6 years is not an edge.
Outcome Summary
It was abandoned at the pre-optimization BACKTEST_REVIEW gate as 'no_edge': this is the single-asset trend/TSM family whose base Sharpe (~0) is the ceiling (L63), so 3-phase deflation and holdout only lower it, and optimizing 3 params on a zero-Sharpe series selects best-of-N noise. The claimed inverse-contract convexity edge did not manifest (flat/negative curve, deep drawdown), and data collected fine so it was not a data wall — just a genuine absence of edge. Optimization, analysis, and risk review were never reached.
Outcome Summary
A long-short, single-instrument, pure-OHLCV trend-follower on the ETH COIN-M inverse perp (ETHUSD_PERP.BINANCE_CM, 4H) using a dual-EMA crossover for direction (spread scaled by ATR) and an ATR chandelier trailing stop with no fixed take-profit, plus a post-exit direction lockout, aiming to harvest the inverse contract's convex USD payoff as trends run.
Outcome Summary
Over 12,683 4H bars (2020-2026) and 168 trades the per-trade edge cleared the fee floor (avg_trade_return_pct 0.463%, commission only 2.96% of gross) but there was no risk-adjusted edge: Sharpe -0.028 (CI [-0.86, 0.73]), PSR 0.47, alpha -0.047, information ratio -0.74, total return -4.74%, 30.6% max drawdown (CI to 51.8%) with a 1,660-day recovery. It was net-negative once the single 2021 bull leg is excluded (2022/2025/2026 all negative) and lost in the stressed vol tercile and every crypto stress window (LUNA, FTX, 2022 rate shock).
Iteration History
Verification failed (Layer 4 — QA review) [class=no_edge]:
- NO VIABLE RISK-ADJUSTED EDGE on the full 2113-day sandbox. Sharpe 0.086 with CI [-0.62, 0.76] straddling zero (indistinguishable from no-skill), alpha -0.028 and information_ratio -0.60 vs buy_hold (negative active edge), total_return +3.95% over 5.8 years — essentially flat — with end_unrealized_pct -32.7% (a large open loser drags even that). avg_trade_return_pct 0.588% and PF 1.29 are nominally above the fee floor but produce no risk-adjusted edge. The differentiating thesis (inverse-contract convexity harvesting) is unsupported — it behaves as an ordinary dual-EMA trend null. Single-instrument directional-OHLCV trend family where base Sharpe is the ceiling; a 3-param sweep cannot lift a 0.086 base past the 0.5 OOS floor and no plausible fix exists.
- Leverage 2.0 amplifies the 29.6% max drawdown (CI to 60%) and the -32.7% terminal open position without buying any edge (Sharpe ~0) — on a no-edge book it only adds risk.
Backtest and paper results are hypothetical. Trading involves risk of loss.