Strategies
SPY/IWM Size-Spread Mean Reversion on DAILY Bars: Beta-Hedged Log-Spread Z-Score (Point-in-Time Rolling Stats), Enter |z|>=2, Exit |z|<=0.5 or 10-Session Clock, Dollar-Neutral Long/Short, Flat ~80% (SPY.USEQ + IWM.USEQ 1D)
Outcome: Abandoned
SpyIwmSizeSpreadMeanReversionDaily
Outcome Summary
The strategy adapted an FMZ intraday SPY/IWM mean-reversion idea to daily bars. It removed the source's look-ahead by using rolling beta and z-score statistics, and it aimed for a dollar-neutral pair whose per-trade capture would clear USEQ costs. Across 3 iterations the code never passed Layer 3 verification: each time, the sandbox backtest went over the 300s limit on a ~2400-day IWM.USEQ daily window. The strategy was abandoned in the verification loop, so the backtest, optimization, analyst and risk stages were never reached and no performance metrics exist.
Hypothesis
This iteration preserves the previous strategy and removes the per-bar O(z_window) spread-statistics loop. Rolling level moments are maintained incrementally, making beta and z-score calculation O(1) per bar while retaining prior-session-only statistics and exact same-timestamp extra-leg alignment.
verification_loop: sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of IWM.USEQ-1-DAY-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).
Implementation
Daily USEQ pair-trading strategy using a point-in-time rolling beta-hedged log-spread z-score between IWM and SPY. It enters at extreme divergences, exits on reversion, blow-up, or a ten-session time stop, and sizes whole-share dollar-neutral legs.
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 IWM.USEQ-1-DAY-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).
Outcome Summary
A multi-instrument daily strategy has to fit inside the sandbox time budget. Find out why the smoke test hangs or runs slowly, for example extra-leg bar alignment or per-bar position and cache lookups, before iterating on signal logic, even when the rolling statistics are already O(1).
It was abandoned in the verification loop after 3 iterations. The Layer 3 sandbox backtest went over the 300s wall-clock limit on a ~20,000-bar window (2400 days of IWM.USEQ-1-DAY-LAST-EXTERNAL), which ended the run before the backtest, analyst and risk stages.
A dollar-neutral, beta-hedged SPY/IWM pair on daily USEQ bars. It traded the z-score of the log-spread ln(IWM) - beta*ln(SPY), using a rolling 60-session return-based beta and a 20-session point-in-time mean and std. It entered at |z|>=2 and exited at |z|<=0.5, after 10 sessions, or at a |z|>=4 blow-up stop.
No performance numbers exist. The strategy never produced a backtest report or an optimization report, so it has no return, Sharpe or trade-count figures.
Analysis
一个运用SPY与IWM之间均值回归的日内交易策略
Backtest and paper results are hypothetical. Trading involves risk of loss.