How many trades do you need in a backtest?
By Oalgo · Last reviewed
There is no single number. The fewer trades a backtest has, the more one lucky or unlucky trade can change its result. Look at the count together with the date range, the fees and how the trades are spread.
Why can a few trades mislead?
#Each trade is a share of the whole result. With 5 trades, one trade is 20% of them. Turn one win into a loss and the win rate moves 20 points. With 50 trades the same change moves it 2 points.
| Trades | Wins | Win rate | If one win became a loss |
|---|---|---|---|
| 5 | 3 | 60% | 40% |
| 50 | 30 | 60% | 58% |
| 100 | 60 | 60% | 59% |
How far can a win rate move by chance?
#Take rules that win half of their trades. A backtest is a sample, so its win rate will not land on exactly 50%. In at least 19 of every 20 backtests of such rules, the number of wins lands inside these ranges by chance alone. The table treats each trade as independent, and real trades are not quite that.
| Trades | Wins usually land between | Win rate between |
|---|---|---|
| 10 | 2 and 8 | 20% and 80% |
| 30 | 10 and 20 | 33% and 67% |
| 100 | 40 and 60 | 40% and 60% |
| 300 | 133 and 167 | 44% and 56% |
So a 70% win rate over 10 trades says almost nothing: rules that win half their trades reach it about 17 times in 100. Over 30 trades it happens about 2 times in 100. Over 100 trades it almost never does.
What else counts besides the number of trades?
#- The date range. 100 trades from one calm week come from one kind of market. Test more than one range.
- The spread. If a few trades make nearly all of the result, the count is smaller than it looks.
- The fees. Rules that trade often pay costs each time, so the count and the costs rise together. Read them in the backtest report.
In Oalgo, the Risk view of a run's Analytics tab has a Result Concentration card. It takes away the 1, 3 and 5 trades with the largest gains and shows how the change in account value moves, so you can see whether a few trades carry the result.
What can a trade count not tell you?
#A large count does not make rules sound. 500 trades from rules tuned to one stretch are still overfitting. A big sample only makes the result steadier. It does not say the next prices will look like the past ones.
Read next
- Is backtesting accurate? What it can and cannot tell youA backtest can be exact about the past and still say little about the future. See what it gets right, where real trading differs, and an example of costs.
- How to read backtest results: a step-by-step guideHow to read backtest results step by step: trades and dates first, then drawdown and fees, and the end result last. Plain definitions of each number.