r/algorithmictrading • u/meme_star1 • 1h ago
Backtest killed my own oil spread system with an audit, here's what it found
been building a mean reversion system on brent/wti and rbob spreads for a while. backtest sharpe was 0.71 so i thought i had something. built an audit harness to stress test it before going bigger and it fell apart.
main problem was roll days. i was using yahoo continuous futures (BZ=F, CL=F etc) and every expiry the series jumps to the next contract. brent and wti roll on different days so the spread jumps too, and my system was treating those jumps as deviations and "trading the reversion". it's not real, you can't earn it.
numbers (attached charts):
+79% cumulative with roll days, +12% without
sharpe 0.71 → 0.21 once roll days removed, -0.11 if you also drop apr-may 2020
permutation test, same rules on 200 surrogate spreads with mean reversion destroyed: p = 0.15
2020 made basically all the money, 4 of 7 years lost
also found bugs in my own backtest. roll cost had a 21 day trigger but max hold was 10 days so it never fired lol. slippage was charged on the log spread instead of the actual notional. trades open at the end of a test window just vanished.
didn't open the holdout since it failed on dev data.
quick check if you use continuous futures: mark the few days around each expiry and see what share of your pnl lands there. if it's way more than the share of days, be suspicious.
happy to answer questions about the method













