How many years of data should a backtest cover?
The window used here runs from 2021-01-04 to 2026-10-02, which is 5.74 years and 1444 sessions of minute-resolution US market data. That is long enough to hold one full bear market and its recovery, and short enough that every conclusion drawn from it carries a wide margin. The useful question is less about the number of years and more about which market conditions the years contain. A window needs to contain conditions that disagree with each other. A rule that only ever saw a rising index has no record of what it does when the index falls for ten months. In this data set the US large-cap fund SPY gained 30.46% in 2021, lost 18.16% in 2022, then gained 26.18%, 24.86% and 17.72% in the three years after. A strategy tested only on 2023 to 2025 would have seen three rising years and nothing else. The practical floor suggested here is five to ten years for a daily-decision rule on ETFs, with at least one drawdown and recovery inside the window. The numbers below show what that floor looks like when it is measured, which funds and strategies it stresses, and where 5.74 years stops being enough. Each number comes from the same engine and the same $10,000 starting account, with no margin and no fees or slippage in the headline runs. The headline measure of a window is how much of the market's behaviour it holds. Years only count as a proxy for that. Two windows of the same length can contain very different tests, and a long window can still repeat one condition many times.
What 5.74 years of data actually contains
Start with the calendar. Buy-and-hold in SPY, with 98% of the account invested at the first open, turned $10,000 into $21,820 over the window, a CAGR of 14.56%. Its worst peak-to-trough fall was 23.99%, from the 2022-01-03 peak to the trough on 2022-10-12. The fund took until 2023-12-13 to recover, so the full cycle from peak to new high ran across two calendar years and 488 sessions inside the drawdown. That single cycle is the main reason this window is worth testing on. Strategies that hold the index through it show a loss, and strategies that step aside show something different. Without 2022 in the window, the two groups would look the same, and the data would not distinguish a rule that manages risk from one that happened to be invested in a rising market. The Nasdaq fund QQQ shows the same cycle with more force. Its calendar returns ran 29.18% in 2021, -32.39% in 2022 and 54.81% in 2023. The buy-and-hold drawdown was 34.23%, from 2021-11-19 to 2022-11-03, with recovery on 2023-12-12 and 516 sessions spent under water. A single year of 54.81% right after a year of -32.39% is the kind of whiplash that a three-year window starting in 2023 would never record. The window also contains smaller events. SPY had a second drawdown of 18.41% between 2025-02-19 and 2025-04-08, recovered by 2025-06-26. A third, of 8.76%, ran from 2026-01-27 to 2026-03-30, with recovery by 2026-04-14. QQQ fell 22.38% in the same early 2025 stretch. These short, sharp falls test different behaviour than 2022. A trend filter that took months to react in 2022 may have no time to react in a 48-day drop, and a mean reversion rule may do its best work in exactly that kind of shock. Count the regimes as well as the years. This window holds a rising year, a long bear market, a very strong rebound year, two further steady years, a sharp 2025 drop and a partial 2026. That is a reasonable spread for a first look at a daily rule, and still a short list. Each regime appears once or twice.
A window can be long and still thin
Length helps only if the extra years add new conditions. Ten more years of a steadily rising index would add trades and lower the noise in a CAGR figure, and would leave the rule untested against a bear market. The reverse also holds: a window of three years that contains a sharp fall and a full recovery says more than six calm years. The SPY record gives a sense of how few independent events a short window holds. SPY closed above its 200-day average on 77.99% of sessions, and crossed that average 30 times. Of those crossings, the long 2022 decline accounts for the stretch where the fund stayed below the line, and the rest are shorter whipsaws. A 200-day rule evaluated on this fund has a few dozen signals to learn from, and they cluster in only two or three market episodes. A different fund shows the same issue from the other side. TQQQ, the three-times leveraged Nasdaq fund, spent 69.48% of sessions above its 200-day average and crossed it 28 times. It also had 56 separate 10% drops from a 20-day high, against 11 for SPY. A rule that buys those drops has more events to work with on TQQQ, so the same 5.74 years supports a statistically firmer reading there than it does on SPY, where 11 events is a small sample. The lesson for window choice is that the count that matters is events per rule. A strategy that trades 166 times as the RSI(2) snapback does at the median can be judged on a short window with some confidence. A strategy that trades twice, as the dip buyer does at the median, cannot, because two trades could be luck in either direction.
A window that suits one asset and punishes another
The same dates can be a good or bad sample depending on the asset. TLT, the long-dated Treasury fund, lost 40.49% in total over this window, a CAGR of -8.64%. It fell 31.21% in 2022 alone, the same year the stock indexes fell. Its drawdown ran from 2021-01-04 and had no recovery date by 2026-10-02, which means the fund spent 1443 sessions below its starting level. The deepest buy-and-hold drawdown was 42.77%. Anyone who judged a bond strategy on these years alone would be judging it against the worst stretch the fund had in this data. The window starts at the peak. A test beginning a few years earlier or later would give TLT a very different baseline, and a rule that looked clever for avoiding the fall might have only been lucky in its start date. That is the argument for a longer window when the asset has a regime of its own. TLT spent 35.18% of sessions above its 200-day average, which is low for a fund and explains why trend rules tend to sit in cash on it. The window contains one bond bear market and nothing before it. Ten years or more would test a trend rule on TLT through at least one different bond regime. Small-cap stocks show a milder version. IWM gained 55.8% in total, a CAGR of 8.03%, and its drawdown ran from 2021-11-08 to a 31.92% trough on 2022-06-16. It did not recover until 2024-11-06, 752 sessions later in the drawdown count. The recovery was slower than SPY's, so a strategy tested on IWM waited much longer to see a new high than the same strategy on SPY.
Leveraged and volatility funds stretch any window
Some funds change what 5.74 years can tell you. TQQQ gained 291.92% over the window and lost 79.07% in 2022. Its drawdown was 81.68% from 2021-11-19 to 2022-12-28, and recovery took until 2024-12-04, 762 sessions inside the drawdown. Calendar returns ran 90.95% in 2021, 198.32% in 2023 and 54.6% in the partial 2026 year. A rule tested on TQQQ across this window sees extremes in both directions, and a single year can dominate the result. UVXY, the short-term volatility fund, is the clearest case of a window deciding the outcome. UVXY lost 99.94% over the window, a CAGR of -72.83%, and every calendar year was negative, from -89.67% in 2021 to -52.77% in the partial 2026. It was above its 200-day average on 4.18% of sessions. Buy-and-hold ended at $215.70 from $10,000. Any test on UVXY says more about the fund's structure than about a particular period, so a longer window changes the size of the loss and leaves the direction the same. For these funds, a longer window is not more informative in the same way as for SPY. Decay and compounding effects mean the path matters more than the endpoint, and the daily rule's result depends on whether its entry dates landed on a spike. The right response is to read the drawdown figures alongside the return figures and to expect that a different start date could move the result a good deal.
What the window did to twelve strategies
The twelve templates give a view of how window length interacts with strategy type. Medians across 59 ETFs are shown for each. The weekly 7% target had the highest median CAGR at 6.61%, with 106 round trips and a median maximum drawdown of 26.26%. The monthly cycle had a median CAGR of 5.46% and the deepest median drawdown at 36.63%, with 69 round trips. The RSI(2) snapback came in at 4.74% median CAGR with a median drawdown of 17.47% and 166 round trips, the most trading of the set. It beat buy-and-hold on 34 of 59 funds, the same count as the weekly 7% target. The slow trend rules were the opposite case. The golden cross made 3 round trips at the median, with a median CAGR of 2.05% and a median drawdown of 21.84%. The 200-day regime filter had 18 round trips, a median CAGR of 1.84%, and beat buy-and-hold on 26 of 59. The SMA 10/50 trend and EMA 12/26 trend sat at 2.12% and 2.76%, with 17 and 22 round trips. Two templates are close to untestable on a window this short. The dip buyer made 2 round trips at the median and had a median CAGR of 1.33%. The momentum breakout made 6 round trips at the median with a median CAGR of 0%. Whatever those medians say, a rule with 2 or 6 trades per fund has not been tested in the way a rule with 100 trades has. A longer window would add trades for these two before it added anything else. The trend plus trailing stop rule had a median maximum drawdown of 31.15% with 4 round trips, and the 3-month momentum rule had 12 round trips with a median CAGR of 0%. The RSI mean reversion template, with a median of 15 round trips, beat buy-and-hold on 25 of 59 funds. Across the set the pattern is consistent with the window length point: strategies that trade often produce a record you can read, and strategies that trade a handful of times produce a record that mostly reflects which dates they happened to enter.
How few signals a rule sees
RSI(14) below 30 is a common oversold trigger. On SPY it occurred on only 18 sessions in this window. On QQQ it occurred on 15, on TQQQ on 18 and on IWM on 33. On TLT it occurred on 61 sessions, and on UVXY on 116. These counts are small enough that a handful of clustered days can dominate any result. The forward numbers show what that means. After SPY's RSI(14) fell below 30, the median five-day forward return was 3.74% against a baseline of 0.42% for all days, and the median 20-day return was 2.86% against 1.73%. Both comparisons rest on 18 observations, and many of those sit in the same few weeks, so the 18 are not 18 independent tests. For QQQ the median 20-day return after a signal was 1.42%, below SPY's, from 15 observations. The RSI(2) below 10 trigger gives a larger sample: 146 sessions on SPY, with a median five-day return of 0.89% and a median 20-day return of 2.29% over the same baseline. That is the kind of signal where the number of years matters less, since the events come often enough to be counted. A longer window would still add new regimes for it, which the extra sessions in this one cannot. TLT's own record shows why this matters. After RSI(14) fell below 30 on TLT, the median five-day return was 0.02% and the 20-day median was -1.63%, below the baseline of -0.6%. The signal there fired 61 times inside one long decline. A rule that buys oversold bonds would look poor here and could look different in a window with a rising bond market.
In-sample, out-of-sample and what 5.74 years leaves out
A backtest is always in-sample to the history it used. Every figure on this page was measured on the full window with no data held back, so none of it is out-of-sample evidence. The definition of the term used here is data the strategy was not developed or tuned on: a later portion of history held back, a different asset, or live paper trading. Window length matters for that split. With 5.74 years, setting aside the last year or two as a holdout leaves a development window that is short and holds one bear market. A holdout taken from 2025 and 2026 would contain the April 2025 drop and the early 2026 pullback, which are shorter events than 2022. A rule that was tuned on 2021 to 2024 and then run through them would at least face conditions it had not seen. A longer window makes the split easier, since both halves can hold a drawdown. The other options are testing on assets the rule was not built on, and paper trading on live data. Paper trading on live data needs no broker, according to the product reference, and it is the one test whose data cannot have been seen in advance. The broader point of backtesting is to estimate how a rule would have behaved, with the caveat that honesty depends on realistic execution assumptions and on not tuning until the past looks perfect. How to read a result once it exists is covered in how to tell if a backtest is trustworthy: window, benchmark, costs, trade list and provenance.
Where this test stops
The window is one stretch of US market history, 2021-01-04 to 2026-10-02. It starts near a market peak for several funds, including TLT, which makes drawdown figures look worse than a start in the middle of the cycle would. It contains one major bear market and one regime of rising short-term rates. The 2026 year is partial. The data is minute-resolution consolidated US market data. Rules make daily decisions and orders fill on minute bars. The headline run has no fees or slippage, and the cost runs on the strategy pages add 5 and 10 basis points. Prices in trade lists are adjusted for splits and dividends, so they are lower than the quotes printed at the time. The structural change argument in the short answer also applies. Markets change, and a rule's performance in a much older period may describe conditions that no longer exist. For that reason the answer to the window question is a range and not a single figure: enough years to include at least one drawdown and recovery, enough trades to read, and enough weight on recent years to reflect current conditions. Each of the strategy and fund pages linked above shows the year-by-year, drawdown and trade-level detail behind these summaries. They are the place to look when a question depends on a specific fund. Backtests are hypothetical, and this one is a single window.
Frequently asked questions
How many years of data should a backtest cover?
Enough to include conditions that disagree with each other, and at minimum one full drawdown and recovery. For daily-decision ETF rules, five to ten years of minute data is a reasonable floor. The window on this site is 5.74 years, from 2021-01-04 to 2026-10-02, and it contains the 2022 bear market.
Is 5.74 years enough for a backtest?
It holds one full cycle: SPY fell 23.99% from 2022-01-03 to 2022-10-12 and recovered on 2023-12-13. That is enough to separate rules that handle a decline from rules that were only invested in a rising market. It is not enough to judge rules with very few trades, such as the dip buyer, which made 2 round trips at the median.
Is more history always better for a backtest?
More history adds regimes and trades, which helps. Markets also change structurally, so very old results may describe conditions that no longer exist. The short answer here suggests weighting recent regimes more than distant ones when judging.
Why does the start date matter so much?
The same fund can look very different from different starting points. TLT lost 40.49% over this window because the window begins at its peak, and it had no recovery date by 2026-10-02. A test that began at another date would show a different baseline.
How many trades does a backtest need?
There is no fixed count in the data here, but the contrast is plain. The RSI(2) snapback made 166 round trips at the median across 59 funds, so its record can be read with some confidence. The dip buyer made 2, and two trades can reflect luck as easily as skill.
Does a longer backtest remove the need for out-of-sample testing?
No. A backtest is in-sample to the history it used. A longer window makes it easier to hold part of it back, and paper trading on live data supplies data the rule has not seen.
Build it from blocks (or type it in English), backtest it on 5.7 years of minute data in seconds, tweak any parameter, then paper trade it on live data. No card, no broker needed to start.
Terms used here
Related questions
Backtests are hypothetical, computed by DeployQuant's engine on minute-resolution consolidated US market data (2021-01-04 to 2026-10-02, $10,000 starting capital, no margin, no fees or slippage in the headline run; buy-and-hold puts 98% of the account in at the first open, as the templates do) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.