Edgoro
Planning · Free tool

Backtest Sample Size Calculator

Find how many trades a backtest needs before its edge is more than noise, with the confidence range of the expectancy and the win rate.

Describe the results with
Confidence

R is the amount you risk per trade. A trade that makes twice its risk is +2R. Enter 1 if this is the only version you tested.

Trades needed to show this edge is real
111
Verdict after 100 tradesNot enough trades
Expectancy per trade+0.26 R
95% range of the true expectancy-0.01 to +0.53 R
t-statistic1.87
Chance of a result this good with no edge3.1%

Win rate and profit factor

95% range of the true win rate35.6% to 54.8%
Trades to pin the win rate to ±5 points381
Profit factor1.47
z used (after the correction)1.960

Normal approximation for the average of independent trades, with a Šidák correction when you tried several versions. It measures noise, not overfitting, regime changes or costs left out of the backtest.

Trading involves substantial risk of loss and is not suitable for every investor. Edgoro is a software tool, not a broker or financial adviser: nothing it produces is investment advice, and past or backtested performance does not guarantee future results.

What the sample size calculator answers

A backtest with 40 trades and a 60% win rate looks like an edge. It may also be a coin that landed heads 24 times out of 40, which happens more often than most people expect. The question is not how good the results look, but how sure they let you be.

This calculator takes the number of trades and how they turned out, and gives the range in which the true expectancy probably sits, whether that range is clear of zero, and how many trades an edge of this size needs before it is. If you tried several versions before keeping this one, it raises the bar accordingly.

How to use it

  1. Enter the number of trades in the backtest (or in your live record).
  2. Describe the results, either as a win rate with the average win and average loss in R, or as the average trade and its standard deviation in R. R is the amount you risk per trade.
  3. Pick a confidence level. 95% is the usual choice.
  4. Enter how many strategies, settings or variants you tried before this one. Enter 1 if it is the only one.

The formulas

expectancy        E  = win rate × average win − loss rate × average loss
spread of trades  sd = (average win + average loss) × √(win rate × loss rate)
range of E        E ± z × sd ÷ √trades
trades needed     (z × sd ÷ E)²

z for 95%         1.96, or Φ⁻¹(1 − α' ÷ 2) with α' = 1 − 0.95^(1 ÷ tries)  (Šidák)
win rate range    Wilson score interval

The spread formula is exact for trades that either win the average win or lose the average loss. With your own list of trade results, use the second mode and enter their average and standard deviation (AVERAGE() and STDEV() in a spreadsheet).

Worked example

A strategy won 45% of 100 trades, with an average win of 1.8R and an average loss of 1R:

  • Expectancy: 0.45 × 1.8 − 0.55 × 1 = +0.26R per trade, a profit factor of 1.47.
  • Spread of the results: 2.8 × √(0.45 × 0.55) = 1.39R.
  • 95% range of the true expectancy: −0.01R to +0.53R. It touches zero, so 100 trades don't yet separate this edge from luck.
  • Trades needed at this edge and spread: (1.96 × 1.39 ÷ 0.26)² = 111.
  • The win rate itself is only known to within 35.6% to 54.8%; pinning it to ±5 points takes 381 trades.

Now say this was the best of 20 settings an optimizer tried. The Šidák correction raises z from 1.96 to 3.02, and the trades needed rise to 262.

Rules of thumb, and why they differ

You'll read "30 trades", "100 trades" and "200 trades". None is right in general, because the answer depends on the size of the edge compared with the spread of the results. Halve the edge and you need four times as many trades. A strategy with a small average gain and large swings may need thousands; a steady one with a big edge, far fewer.

Win rateAvg winAvg lossExpectancyTrades needed (95%)
45%1.8R1R+0.26R111
40%2R1R+0.20R208
55%1R1R+0.10R381

What it can't fix

  • Overfitting. The correction for several tries assumes they were independent. A grid of similar settings is partly the same test, and the calculator can't see choices you made by looking at the chart.
  • Regime changes. Trades from one kind of market say little about another. Spread the test across years and conditions; walk-forward analysis is the standard way.
  • Dependence. Trades that overlap in time, or that cluster in streaks, carry less information than the same number of independent trades.
  • Costs. An edge that only exists before fees is not an edge. Check it with the trading fee calculator.

For the related question of how good a profit factor has to be, read what is a good profit factor. To test a Sharpe ratio after many tries, use the deflated Sharpe ratio calculator.

Frequently asked questions

How many trades do you need to backtest a strategy?

Enough for the confidence range of the expectancy to sit above zero. That depends on the edge and the spread of the results: (z × standard deviation ÷ expectancy)². A strategy winning 45% of the time with 1.8R wins and 1R losses needs about 111 trades at 95% confidence; one winning 55% at 1:1 needs about 381.

Is 100 trades enough for a backtest?

Sometimes. 100 trades are enough for a large, steady edge and too few for a small one. Enter your numbers in the calculator: if the range of the expectancy still includes zero, it isn't enough.

Why does testing many versions need more trades?

The more versions you try, the more likely one looks good by luck. The Šidák correction asks each test for stronger evidence so that the whole search keeps the confidence you chose; after 20 tries at 95%, z rises from 1.96 to 3.02.

What does the confidence range mean?

If you could repeat the backtest on many different histories of the same market, a 95% range built this way would contain the true expectancy in about 95% of them. A range that includes zero means the data can't rule out a strategy with no edge.

Does a significant result mean the strategy will work live?

No. It means the backtest result is unlikely to be noise. Look-ahead bugs, overfitting, missing costs and changes in the market can still make a significant backtest fail.

Related guides

All guides
All free tools

Let AI build the indicator behind your numbers.

Turn the rules you just calculated into a TradingView indicator, an MT5 bot or a crypto bot. Instant access, with a 7-day money-back guarantee.