Strategies
Small-Portfolio 12-1 Month Momentum on the Nine Original Select Sector SPDRs: Long Top-3 / Short Bottom-3, Equal-Weight 50/50 Gross, Monthly Rebalance (USEQ DAILY, long-short, 2 parameters)
Outcome: Abandoned
SectorSpdr12m1MomentumTop3Bottom3LS
Outcome Summary
SectorSpdr12m1MomentumTop3Bottom3LS adapted QuantConnect's small-portfolio momentum strategy to the nine original sector SPDRs, going long the top-3 and short the bottom-3 by 12-1 month return with a monthly rebalance on the zero-commission USEQ venue. Over 3 iterations the code never passed verification, because each Layer 3 sandbox backtest ran past the 300s wall-clock limit on the ~20,000-bar window. The run was abandoned in a verification loop, so no backtest, optimization, analyst or risk stage produced results, and the momentum hypothesis was never tested.
Hypothesis
Preserves the existing validated implementation and fixes the Layer-3 timeout by caching the momentum calculation and portfolio ranking until the next calendar-month rebalance. Daily bars still update the synchronized rolling buffer, while ordinary bars avoid repeated momentum scans and sorting. The monthly schedule remains anchored to bar timestamps for restart parity.
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 XLB.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
Monthly 12-1 momentum ranking across the nine original Select Sector SPDR ETFs. Holds equal-weight long positions in the top three sectors and short positions in the bottom three, with 50% gross exposure per side.
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 XLB.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).
Iteration History
Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['skip_days', 'n_per_side', 'min_notional', 'lookback_days', 'gross_per_side'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: AttributeError: '_MockCache' object has no attribute 'orders_inflight' (bar timestamp: 1735706040000) - steady_downtrend: AttributeError: '_MockCache' object has no attribute 'orders_inflight' (bar timestamp: 1735706040000) - flat_ranging: AttributeError: '_MockCache' object has no attribute 'orders_inflight' (bar timestamp: 1735706040000) - volatility_spike: AttributeError: '_MockCache' object has no attribute 'orders_inflight' (bar timestamp: 1735706040000) - zero_volume: AttributeError: '_MockCache' object has no attribute 'orders_inflight' (bar timestamp: 1735706040000) - price_gap: AttributeError: '_MockCache' object has no attribute 'orders_inflight' (bar timestamp: 1735706040000)
Outcome Summary
The multi-instrument per-bar path has to stay cheap enough to finish the 20k-bar smoke test in 300s: re-rank only at month boundaries and avoid per-bar order-cache queries across all legs, which here ran on every bar through calculate_signal/_reconcile.
It was abandoned in a verification loop after 3 iterations, because the Layer 3 sandbox backtest went over the 300s wall-clock limit on a ~20,000-bar (2,400-day) XLB.USEQ daily window. Backtest review, optimization, analyst review and risk review never ran.
Capture 12-1 month sector momentum by going long the top-3 and short the bottom-3 of the nine original Select Sector SPDR ETFs (USEQ daily), equal-weight at 0.5 gross per side, rebalanced monthly.
No performance was measured: the backtest report is empty and there is no optimization report, so no return, Sharpe or trade count exists. The hypothesis only projected roughly +0.8% mean per-leg trade return against about 0.04% round-trip cost and 500-700 lifetime round trips.
Analysis
Momentum Effect in Stocks in Small Portfolios
Backtest and paper results are hypothetical. Trading involves risk of loss.