Strategies
Country-ETF 36-Month Loser Reversal, Long-Only, 12 Overlapping Monthly Cohorts (8 USEQ single-country ETFs, DAILY bars) — faithful-mechanism adaptation of QuantConnect/Quantpedia country-index mean reversion
Outcome: Abandoned
CountryEtfLoserReversalCohorts
Outcome Summary
CountryEtfLoserReversalCohorts adapted a 19-country, 36-month long/short reversal rule to the 8 single-country ETFs in USEQ, dropping the short leg and using 12 overlapping monthly cohorts that each buy the two worst negative 36-month losers. The code implemented a custom cross-leg alignment barrier and O(1) deque-based formation returns, following the hypothesis's warning about sandbox timeouts. Even so, the run was abandoned after 2 iterations with reason 'coding_stuck_3_timeouts', so it never produced backtest metrics and never reached review, optimization or analysis.
Hypothesis
coding_stuck_3_timeouts
Implementation
Long-only 36-month loser reversal on the 8 USEQ single-country ETFs (EWG, EWJ, EWT, EWU, EWY, EWZ, FXI, INDA), daily bars. On the first aligned session of each calendar month, cohort slot (month % 12) is re-formed. It buys the 2 names with the worst 756-session price return, and only if that return is negative; an unfilled slot stays in cash. Each cohort holds for 12 months and gets 1/12 of 98% equity, split into 2 equal name slots, sized in whole shares. The book target per ETF is the sum of cohort share counts, and each month only the net difference per ETF is traded: a BUY to add, a reduce-only SELL to trim, a full close when the target reaches 0. Eligibility is point-in-time: a name needs 757 closes of history in the run (INDA and FXI join late).
Iteration History
sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of EWG.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
This complex, multi-leg, long-lookback daily-bar design never got through coding before hitting repeated timeouts, so a future iteration should start from a simpler, cheaper implementation that can produce a first backtest.
The strategy was abandoned at the coding stage with reason 'coding_stuck_3_timeouts', after 2 iterations. The backtest-review, analyst and risk-officer stages never ran.
A long-only adaptation of the Quantpedia country-index mean-reversion rule: each month, buy the 2 worst 36-month (756-session) performers among 8 USEQ single-country ETFs, only if their 36-month return is negative, and hold each of 12 overlapping monthly cohorts for 12 months.
There are no performance numbers. The backtest report is empty, no optimization ran, and there is no return, Sharpe or trade count.
Analysis
Mean Reversion Effect in Country Equity Indexes
Backtest and paper results are hypothetical. Trading involves risk of loss.