VALYNOX
VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Backtesting and validation

Best timeframe for backtesting: 5-minute, 60-minute or daily bars?

There is no single best timeframe for backtesting. Pick the bar size where the rule's typical move per trade is several times the round-trip cost and the history still holds a few hundred completed trades, then confirm the result on the bar sizes just below and above it.

By · Published · updated · Editorial policy

Contents
  1. Which bar size is best for backtesting a futures strategy?
  2. How many trades per year does each bar size give, and how much confidence?
  3. Is a 15-minute or a daily backtest more accurate?
  4. What do small bars assume about fills inside the bar?
  5. Do smaller bars overfit more?
  6. How do you test that a strategy survives neighbouring bar sizes?
  7. Frequently asked questions
  8. References

Which bar size is best for backtesting a futures strategy?

The best timeframe for backtesting a futures strategy is the bar size where the rule's typical move per trade is several times the round-trip cost and the history still holds enough completed trades. No bar size wins by itself: 5-minute, 60-minute and daily bars trade off trade count against cost per trade, so the numbers decide, not the chart you like to watch.

A bar is one candle on the chart: the open, high, low and close of all trades inside one fixed stretch of time, such as five minutes or one day. The bar size (K棒週期) sets how often the rule can look at the market and how often it can act. Backtesting means replaying the rule on old prices with costs included, and the guide to what backtesting in trading means covers the rest of the setup. Here the question is narrower: how to choose the bar size.

The same year of history becomes a very different data set at each bar size. Take a CME equity index future such as NQ, which trades about 23 hours a day with a one-hour break. One year of about 250 trading days gives roughly 23 × 12 × 250, or about seventy thousand, 5-minute bars; roughly 23 × 250, or about six thousand, 60-minute bars; and about 250 daily bars. Exchanges can change session hours, so check the contract page of the exchange, or look the session up in the free futures market hours tool in your own time zone.

What changes5-minute bars60-minute barsDaily bars
Bars per year (23-hour session)about seventy thousandabout six thousandabout 250
Typical move per tradesmallmediumlarge
Cost share of each tradehighmediumlow
Fill assumptions inside the barfewsomemany
Trades per yearmanymediumfew
One year of a 23-hour futures session at three bar sizes: 5-minute bars give about seventy thousand bars, small moves, a high cost share, few fill guesses and many trades; 60-minute bars give about fifty-eight hundred bars and medium values; daily bars give about 250 bars, large moves, a low cost share, many fill guesses and few trades No bar size wins every row One year, 23-hour session helps hurts 5-min 60-min Daily Bars a year ~70k ~5.8k ~250 Move size small medium large Cost share high medium low Fill guesses few some many Trades a year many medium few
One year of history at three bar sizes. Trade count and cost share move in opposite directions, and so do move size and fill assumptions.

Read the table from both ends. Smaller bars give more trades and more certainty about the average trade, but each trade captures a smaller move, so commission and slippage eat a larger share. Larger bars capture larger moves, so costs matter less, but the history holds few trades and the backtest has to guess more about what happened inside each bar. The bar size that fits a rule sits where both sides are acceptable.

How many trades per year does each bar size give, and how much confidence?

Moving from daily to 60-minute to 5-minute bars multiplies the number of trades the same history can produce, and the trade count is what sets how much you can trust the average trade. A rule that trades once every few dozen bars produces a handful of trades a year on daily bars and hundreds or thousands on 5-minute bars.

Hypothetical example

Suppose a rule trades once every 40 bars on average, on a 23-hour futures session. In one year it produces about 6 trades on daily bars, about 145 trades on 60-minute bars and about 1,750 trades on 5-minute bars. To reach 100 completed trades, the daily version needs roughly sixteen years of history; the 5-minute version reaches 100 trades in a few weeks.

The reason trade count matters is how an average behaves. An average of a dozen trades moves a long way when two or three trades are replaced; an average of a few hundred barely moves. The formula to keep in mind:

uncertainty of the mean trade = spread of individual trades ÷ √N

The spread of single trades is how far one trade result typically sits from the average (the standard deviation). N is the number of completed trades, and √N is its square root. Because the square root grows slowly, four times as many trades are needed to halve the uncertainty: 25 trades leave an uncertainty of one fifth of the spread, 100 trades one tenth, 400 trades one twentieth, and sixteen hundred trades one fortieth.

Uncertainty of the average trade as a share of the single-trade spread: 20 percent with 25 trades, typical of daily bars; 10 percent with 100 trades, about 60-minute bars; 5 percent with 400 trades, about 15-minute bars; 2.5 percent with sixteen hundred trades, about 5-minute bars 4× trades, half the doubt Uncertainty (% of spread) by trades 25 20% ≈ daily 100 10% ≈ 60-min 400 5% ≈ 15-min 1.6k 2.5% ≈ 5-min Halving it takes 4× the trades. So: aim for a few hundred trades.
The uncertainty of the average trade falls with the square root of the trade count. Each halving needs four times as many trades.

A real daily-bar run shows the problem concretely. The box below is a search run by AlphaPrime (Valynox) on NQ daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $10 slippage per trade. The search tried 1,024 candidates and kept the one with the best return against its drawdown. The kept candidate uses a Fair Value Gap rule as its only entry and exit, with no stop, no target and no filters. It is a stand-in rule built from standard indicators, chosen to show what a daily-bar trade count looks like, not a test of the bar-size question itself.

Source: AlphaPrime product engine (CPU), run 2026-10-31. NQ daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $10 slippage per trade.

NumberResult
Net profit (closed trades)$179,675
Max drawdown$134,405
Trades88
Win rate62.5%
Profit factor1.647
Average trade$2,041.76
Time in market91.48%

The first number to read is 88 trades in six and a half years. The square root of 88 is about 9.4, so the uncertainty of the average trade is about one tenth of the single-trade spread, and on daily NQ bars that spread is large. The net profit and the average trade belong to the one candidate kept out of 1,024, and picking the best after the fact flatters every figure in the box; a 5-minute version of the same search would have thousands of trades per candidate to judge it by. Read this the same way you would read a few weeks in a paper account: the comparison of free day trading simulators and backtesting makes the same point, that a small number of trades is a hint, not a result.

Find the trade count in the summary before you read any performance number. It tells you how much weight the rest of the report can carry.
Find the trade count in the summary before you read any performance number. It tells you how much weight the rest of the report can carry. NQ · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

Is a 15-minute or a daily backtest more accurate?

Neither bar size is more accurate by itself; a backtest is as accurate as its cost and fill assumptions at that bar size. Small bars capture small moves, so commission and slippage take a large share of each trade and a small error in the slippage estimate changes the result. Daily bars capture large moves, so costs matter little, but they add overnight gaps that can jump past a stop, and they hold few trades.

Source of error15-minute barsDaily bars
Cost share of the moveLarge; one tick of extra slippage can flip the signSmall; costs rarely decide the result
Overnight gapsOnly for positions held across the session breakEvery trade; a stop can be jumped by the open
Trades to judge byHundreds per yearA handful to a few dozen per year
Fills inside the barSmall range per bar, less guessingWide range per bar, more guessing
Years of data neededFewMany

Round-trip cost is the commission, fees and slippage of one entry plus one exit, added together. The point of comparison is the gross move per trade, in the same units. NQ moves $20 per index point, so the same $30 round-trip cost is a different share of each bar size's typical move.

Hypothetical example

Suppose a rule captures a gross move of 10 NQ points on 5-minute bars, 40 points on 60-minute bars and 150 points on daily bars, and the round-trip cost is $30. At $20 per point the moves are $200, $800 and $3,000. The $30 cost is 15 percent of the 5-minute move, 3.75 percent of the 60-minute move and 1 percent of the daily move. Double the slippage and the 5-minute strategy loses a quarter of its gross move; the daily strategy loses two percent.

Hypothetical NQ example with a 30-dollar round-trip cost: the cost is 15 percent of a 200-dollar 5-minute move, 3.75 percent of an 800-dollar 60-minute move and 1 percent of a three-thousand-dollar daily move Costs bite small bars Cost as a share of the gross move Assumption: $30 cost Illustration 5-min $200 gross 15% cost 60-min $800 gross 3.75% cost Daily $3k gross 1% cost Small bars pay most per move. So: rerun with doubled slippage.
Hypothetical example. The same round-trip cost, 1.5 NQ points, is a large share of a 5-minute move and a small share of a daily move.

This is the core of the intraday vs daily strategy choice. For an intraday strategy, the honest test is to rerun with doubled slippage and see whether the average trade stays positive; the methods in how to model commission and slippage in a backtest show how to set the starting values. For a daily strategy, the honest test is to count the trades and to look at how often the open gapped past the stop level.

What do small bars assume about fills inside the bar?

The smaller the bar, the more of the price path the backtest actually sees, so the result rests on fewer assumptions about where orders filled. A bar records only four prices. A 60-minute bar with a range of 60 points hides the path price took between them; twelve 5-minute bars of the same hour show most of it.

An intrabar fill is a fill that happens at a price inside the bar's range rather than at its open or close, such as a stop or a limit touched during the bar. When a stop and a target both sit inside one bar's range, the four recorded prices cannot say which one price reached first. The backtest has to choose a convention, and the convention decides whether that trade is counted as a win or a loss. The article on stop or target first inside one bar lists the conventions and how far they move a result.

One 60-minute bar spans both the stop and the target, so its four prices cannot say which was hit first; the same hour drawn as twelve 5-minute bars shows price touching the stop first and the target later, so the trade was a loss Stop or target first? Same hour, two bar sizes 60-min 12 × 5-min Target Entry Stop ? 1st 2nd The small bars show a loss. So: rerun on smaller bars.
The 60-minute bar cannot say whether the stop or the target was hit first. The twelve 5-minute bars show the stop came first.

Next-bar execution is the convention of deciding on the close of one bar and filling at the open of the next, so the backtest never trades at a price the rule could not have known. On daily bars this means every signal waits for the next day's open, which can be far from the previous close. On 5-minute bars the wait is five minutes and the open is usually close to the previous close. The bar size therefore sets both how much fill guessing is needed and how much the next-bar delay costs. Because AlphaPrime's backtesting fills every order on the next bar and charges fees and slippage inside each evaluation at whatever bar size the data has, rerunning one rule on 60-minute and then on 5-minute bars shows how much of its result was riding on the hidden path inside the larger bar.

Do smaller bars overfit more?

Smaller bars do not overfit by themselves; overfitting grows with the number of variants tried relative to the number of trades that judge them. Overfitting is tuning a rule so closely to one stretch of history that it describes the noise in that stretch rather than a repeatable pattern. Bar size enters only through those two counts.

Two things pull small bars toward the risky side. First, small bars tempt more parameters and more tries: a 5-minute strategy often adds a session filter, a volatility filter and a time-of-day exit, each with settings to tune, and each setting multiplies the number of variants. Second, a 5-minute bar carries more noise relative to its move. A few ticks of random order flow are a large part of a 5-minute range and a tiny part of a daily range, so a 5-minute rule has to find its pattern through more noise per bar. Daily bars pull the other way: few parameters are usual, but the trade count is small, so even a modest number of tries can find a lucky winner.

Overfitting risk in a two by two grid: few trades and few tries is medium risk, where daily bars tend to sit; few trades and many tries is high risk; many trades and few tries is low risk; many trades and many tries is medium risk, where 5-minute bars tempt you Overfitting: tries vs trades Few tries Many tries Few trades Many trades Medium Daily, simple High Lucky winner Low Best place Medium 5-min, tuned
Overfitting risk is set by trades and variants together. Daily bars start in the few-trades row; 5-minute bars tempt the many-variants column.

Bailey, Borwein, López de Prado and Zhu (2014) show that the best result from a large number of tries is expected to look good in-sample even when none of the tries has an edge, and that the length of history needed to separate the best from luck grows with the number of tries. Bailey et al. (2017) turn this into a probability that the chosen variant is overfit, which rises with the number of candidates compared on the same data. Both results are about counts, not bar sizes. The summary in why the best backtest is usually inflated walks through the numbers.

What to watch, at any bar size, is the ratio of variants tried to trades available. Keep a written count of how many settings and rule combinations the search covered, read the trade count of the kept candidate, and treat a daily-bar winner found among a thousand tries with 88 trades with the same suspicion as a 5-minute winner found among a million tries with a few thousand trades.

How do you test that a strategy survives neighbouring bar sizes?

Run the same rule unchanged on the bar sizes just below and above the one you chose, and trust the result only if it holds across all three. A rule that behaves alike on 45-, 60- and 90-minute bars rests on a pattern that exists in the price series. A rule that works only at exactly 60 minutes describes the noise of that one bar size, because nothing in the market knows where your bars begin and end.

  1. Freeze the rule and its settings. Change nothing: the same lookbacks, the same costs, the same session, the same execution convention.
  2. Pick two neighbours. Use roughly three quarters and one and a half times the chosen bar size: 45 and 90 minutes for a 60-minute rule, 4-minute and 8-minute bars for a 5-minute rule, 2-day and weekly bars for a daily rule.
  3. Rerun on both neighbours. Lookbacks measured in bars now cover different stretches of time; that is intended, because it tests whether the pattern is tied to time or to your bar count.
  4. Compare the average trade after costs and the trade count. Some change is normal, because the lookback now covers a different amount of time. A sign change or a collapse to near zero is the signal to stop.
  5. Write the pass rule first. For example, both neighbours must keep at least half of the chosen bar size's average trade.

Hypothetical example

Rule A, average trade after costs across 30-, 45-, 60-, 90- and 120-minute bars: $55, $62, $68, $60, $52. Rule B, same bar sizes: $5, $8, $70, $4, −$6. Both show $68 to $70 at 60 minutes. Rule A has a plateau and passes; its 60-minute result is the top of a broad hill. Rule B has a spike and fails; move the bar boundaries by fifteen minutes and the edge is gone.

Hypothetical average trade after costs across 30, 45, 60, 90 and 120 minute bars: rule A forms a plateau at 55, 62, 68, 60 and 52 dollars and passes; rule B spikes at 5, 8, 70, 4 and minus 6 dollars and fails A plateau beats a spike Avg trade after costs; bars in minutes Illustration $0 Plateau Spike 30 45 60 90 120 Only the plateau passes. So: test the bar sizes next door.
Hypothetical example. The plateau is a pattern in the prices; the spike is a pattern in one set of bar boundaries.

This check is the same idea as the parameter plateau used for lookbacks and thresholds, applied to the bar size. It needs software that can rerun the same rule at another bar size without rewriting it; the list of checks in what to look for before paying for backtesting software puts that ability near the top. Take the strategy you trust most today, rerun it unchanged on the bar size just below and just above the one you use, and put the three average trades after costs side by side before you read anything else in the reports.

Frequently asked questions

Should I backtest on the same bar size I will trade?

Yes, as the main test. The bar size sets the signal timing, the next-bar delay and the fill assumptions, and all three change the result. Test on the bar size you will trade, then rerun unchanged on one neighbour below and one above to check the result is not tied to one set of bar boundaries.

How many years of 5-minute data do I need?

Count trades, not years. A 5-minute rule that trades a few times a day reaches several hundred completed trades within one or two years, which is enough to read the average trade with some confidence. Add more years anyway to cover more than one kind of market: a trending stretch, a quiet stretch and a volatile stretch.

Can I test a daily strategy on 60-minute data to get more trades?

You can run the rule on 60-minute bars, but it becomes a different strategy, because its lookbacks now cover hours instead of weeks. The extra trades tell you about the 60-minute version, not the daily one. To get more daily-bar trades, use a longer history or more markets, and read the small trade count honestly.

What is the difference between an intraday and a daily strategy in a backtest?

An intraday strategy opens and closes within the session, so it captures small moves, pays costs on many trades and avoids overnight gaps. A daily strategy holds across sessions, captures larger moves, pays costs on few trades and faces gaps at every open. The first is sensitive to the slippage you assume; the second is sensitive to its small trade count.

References

  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2017). The Probability of Backtest Overfitting. Journal of Computational Finance, 20(4), 39–69.
  • CME Group. E-mini Nasdaq-100 Futures contract specifications (contract size $20 × index, minimum tick 0.25 index points = $5.00). cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html