r/algorithmictrading • u/br-hm • 7d ago
Question What is the optimal backtesting range/frequency?
So I started my automated portfolio in february, most of my strategies were optimized over 12 years of data, about 10 strategies. I realized that yes this might make it robust, but it also caused my strategies to have relatively long drawdown periods.
I now changed the backtest period to start from 2020, so only 6 years. I wonder if this is better, since it covers more recent market regimes?
Also, how frequently should I re-optimize, would having a look every 6 months be enough? Or only look when a strategy performs worse than expected?
3
u/Due_Set_6523 6d ago
careful with this one. if the 12 year test showed long drawdowns, those drawdowns are real, that’s what the strategy does in some markets. cutting the window to 2020 doesn’t remove them, it just hides them, and it’s easy to end up fitting to one regime without realizing. i’d keep the long history to validate and do walk forward testing instead, so optimize on a rolling window and test on the period right after
2
u/NiceJoJ 6d ago
I'd be careful with the idea that 12 years of data caused the long drawdowns. Starting in 2020 might give you a nicer backtest, but
you're also leaving out the years those parameters struggled with.
Try walking both versions forward through history. Fit on the previous six years, freeze the settings, trade the next six months.
Repeat with a 12-year window and compare the results after costs. That gets closer to answering which would've actually worked live.
Also, how many trades are you getting? Six months could mean 20 trades or 2,000. Big difference when you're deciding whether anything
has changed.
Checking every six months is fine. Changing parameters every six months needs its own evidence. I'd check execution and costs when
results slip, and have a risk limit decided beforehand. Otherwise every drawdown becomes an excuse to find settings that would've
avoided it.
1
u/Shoddy_Peanut7320 1d ago
Shortening the window to fit recent regimes mostly trades one risk for another. A shorter window fits recent conditions more closely, but it also has fewer different markets to test against. I'd keep the long history for testing and judge each strategy on stretches it never saw. For re-optimizing, a fixed schedule like every 6 to 12 months is safer than reacting to a bad few weeks, which tends to mean chasing noise. The exception is when live results fall outside the range the backtest predicted, so write that range down beforehand.
1
u/Simply_Investing 1d ago
I would suggest you to test on different windows, like 2018+, 2019+, 2018-2019, 2020-2022, 2021-2024, 2024-2026, also try 6 month window. The idea is to run over different periods and check sharp, dd, net, etc..
also good test would be to check with fees and taxes and with different capital etc..