Introduction to Quant Finance · Lesson 10
Sample size
Why 10 trades say little: how far luck can move a win rate or an average after 10, 100 and 1,000 trades, and how many it takes to tell a winning strategy from a coin flip.
Know the basics? Read the lesson notesTen trades
Here is a made-up trading strategy. We built it, so we know something you never know in real life: in the long run it wins 60% of its trades. That is its true win rate, the share of trades it wins.
The trades you happen to see are a sample, and how many there are is the sample size. Take a sample of 10 trades. Then take five more, each from a separate run: the same strategy, started fresh.
One strategy, 10 trades at a time (simulated)
Top: this run's 10 trades, filled for a win. Bottom: a dot for each run's win rate; the orange dot is the run you are on now. Dashed: the true 60%.
Six runs of one strategy, and the win rate came out at 80%, 80%, 40%, 30%, 70% and 40%. Nothing about the strategy changed. With 10 trades, each one moves the win rate by 10 points (a point is one percentage point: 40% to 50% is 10 points), so two or three lucky trades swing it a long way.
Keep trading
Run #1 won 8 of its first 10 trades: 80%, well above the true 60%. Let it trade on to 1,000 and watch its win rate so far.
Run #1's win rate so far (simulated)
The line is the share of trades won so far. Dashed: the true 60%. The marks along the bottom go 1, 10, 100, 1,000: each is ten times the last. At the end, three more runs appear in grey.
80% after 10 trades, 65% after 100 and 61.1% after 1,000. Nothing pulled it back: the lucky early trades are still in the count. They just weigh less. After 10 trades, one trade is worth 10 points of win rate (100 ÷ 10). After 1,000, a tenth of a point (100 ÷ 1,000 = 0.1).
This settling is called the law of large numbers: as trades add up, what a sample measures settles toward the true value.
How far can luck move it?
That was one run. Next come 10,000 separate runs of this strategy, and each one's win rate after 100 trades. Leave out the 250 luckiest runs and the 250 unluckiest, so you look at the middle 95 in every 100.
How far from the true 60% will those win rates reach?
10,000 runs
Here are the 10,000 runs, piled into a hill of bars. The shaded band holds the middle 95 in 100 of them. It starts at 10 trades a run. Slide to 100, 400 and 1,000.
The win rate of 10,000 runs, by sample size (simulated)
Each bar counts the runs whose win rate landed there. Dashed: the true 60%. Shaded: the band.
At 10 trades the band runs from 30% to 90%: 60 points wide. A strategy that truly wins 60% can show you almost anything. At 100 trades it still runs from 50% to 69%, about 10 points either side: the widest guess was the right one. At 1,000 it is 56.9% to 63.0%, 6.1 points wide.
More trades narrow the hill and its band, but slowly. From 10 trades to 1,000 is 100 times the trades, and the band got about 10 times narrower (60 points to 6.1), not 100 times.
Four times the trades
From 100 trades to 400, four times as many, the band went from 19 points wide to 9.6: about half. Luck shrinks with the square root of the number of trades. The square root of 4, written √4, is 2, because 2 × 2 = 4. So four times the trades gives half the width.
At 1,000 trades the band is 6.1 points wide. About how many trades would it take to halve that, to about 3 points?
Strategy or coin?
Now picture a rule that trades on a fair coin flip. In the long run it wins 50% of its trades. With wins and losses of the same size it makes nothing on average: it has no edge, no advantage. Our strategy's true 60% is a big edge.
You get one sample and see only its win rate. How many trades must the sample have before our strategy nearly always shows a win rate that almost no coin sample reaches (only 2 or 3 in 100 get that high), so one sample could tell the two apart?
Two hills
Grey: 10,000 runs of the coin. Orange: the 10,000 runs of our 60% strategy. The shaded band is now the coin's: the middle 95 in 100 coin runs. A strategy run above it shows a win rate the coin rarely reaches. Try each sample size.
A coin and the strategy, 10,000 runs each (simulated)
Bars count runs by win rate. Shaded: the coin's band. Orange bar on top: the strategy's band.
At 10 trades the hills sit almost on top of each other: only 470 of the strategy's 10,000 runs land above the coin's band. At 100 trades the coin's band runs from 40% to 60% and the strategy's from 50% to 69%, so they overlap. More than half of the strategy's runs, 5,376, land inside the coin's band. At 400 trades the bands have just come apart, and 9,774 runs land above: about 400 was the right guess.
So even an edge as big as 60% against 50% needs a few hundred trades before one sample shows it. A smaller edge needs more.
How far luck moves an average
The law of large numbers says a sample's average settles toward the true average: the long-run average trade, as 60% was the long-run win rate. This card says how fast. The standard deviation, written σ, is how far a typical result lands from the average. Add up n trades and wins and losses partly cancel, so the total swings only √n times as far as one trade, not n times: its standard deviation is σ × √n (lesson A5). An average is that total divided by n: for 100 trades the total spreads by σ × 10, and dividing by 100 leaves σ ÷ 10. In general:
- σaverage
- the standard deviation of a sample's average: how far luck typically puts the average of n trades from the true average (textbooks call it the standard error)
- σ
- the standard deviation of one trade's result (σ is the Greek letter sigma)
- n
- the sample size: the number of trades in the sample
How to read it: averages from many samples pile into a hill around the true average, a bell curve. About 68 in 100 land within one σaverage of it. The other 32 split evenly, so luck alone puts an average more than one σaverage above the true value about 1 time in 6.
A win rate is an average too. Count each win as 1 and each loss as 0: 6 wins in 10 trades average 6 ÷ 10 = 0.6, or 60%. With a win rate anywhere near a half, a win (1) sits about 0.5 above that average and a loss (0) about 0.5 below. So for one trade counted this way, σ is about 0.5.
σ ≈ 0.5 and n = 100: 0.5 ÷ √100 = 0.5 ÷ 10 = 0.05, which is 5 points of win rate. Measured across your 10,000 runs: 4.9 points.
- each trade's result doesn't change the next one's (the trades are independent);
- the strategy stays the same throughout, so there is one true average.
Results that come in clumps spread wider than this (lesson C2, Volatility clustering), and a rule that stops working partway has no single true average (lesson C3, Regimes and decay).
For the precise: one trade's σ, exactly
Counted as 1 or 0, one trade with a true win rate p (as a fraction) has σ = √(p × (1 − p)): 0.5 at 50%, 0.49 at 60% and 0.46 at 70%. So "about 0.5" is close from 30% to 70%, and too big outside that range. Lesson B5 uses the exact version.Try it on new numbers. A trade's result can also be counted in money. R is a fixed amount like €10, so a trade that wins €20 made +2R. One trade has a standard deviation of 2R. Over a sample of 400 trades, what is the standard deviation of the average trade, in R?
The band for a win rate
Win rates from many samples pile into the hill you saw, a bell curve. On a bell, about 95 results in 100 land within two standard deviations of the middle. The band holds 95 in 100, so it reaches two standard deviations of the win rate either side of the true one: 2 × 0.5 ÷ √n = 1 ÷ √n as a fraction, which is 100 ÷ √n points. That reach is called the margin of error.
- p
- the true win rate, in percent
- n
- the sample size: the number of trades in the sample
- 100 ÷ √n
- the margin of error, in points: how far either side of p the win rates of about 95 samples in 100 land (± means that far above and that far below). A rule of thumb for win rates from about 30% to 70%
100 trades: 100 ÷ √100 = 100 ÷ 10 = 10 points. Strategy: 60 ± 10, so 50% to 70% (measured: 50% to 69%). Coin: 50 ± 10, so 40% to 60% (measured: the same). They overlap.
400 trades: 100 ÷ √400 = 100 ÷ 20 = 5 points. Strategy: 55% to 65%. Coin: 45% to 55%. The bands just touch: that is where yours came apart.
Why there: each band reaches the margin of error either side of its own true rate, so two bands meet when margin + margin equals the gap between the true rates (5 + 5 = 10). So two bands stop overlapping once the margin of error is half the gap.
- the last card's conditions hold: independent trades, one true win rate;
- the win rate is between about 30% and 70%, with at least a few dozen trades (at 10 it is only rough).
You know only a sample's win rate, not the true one: turning a sample into a range for the true rate is lesson B5, Sampling error and confidence intervals.
Try it on new numbers. A fair coin is flipped 2,500 times. Where does its band reach?
What this means for your backtest
A backtest runs a trading rule over past prices to see what it would have made. Its trades are one sample. Two points follow.
- A win rate can't be read without its trade count.
70% over 10 trades sits inside the coin's band (20% to 80% in our runs). 70% over 1,000 trades is far above it (46.9% to 53.2%). The win rate alone is the thing to read only when wins and losses are the same size, as here. If they differ, judge the average trade.
- Inside the coin's band means "can't tell", not "no edge".
More than half of our 60% strategy's 100-trade runs landed inside the coin's band. A short test that looks like luck hasn't shown that nothing is there.
"Wins 70% of its trades"
Could a fair coin, with no edge at all, have produced that win rate? (√10 ≈ 3.16; any phone calculator has a √ key.)
A smaller edge
How many trades is that? Two bands stop overlapping once the margin of error, 100 ÷ √n, is half the gap.
Hint: half of 5 points is 2.5. 100 ÷ √n = 2.5 means √n = 100 ÷ 2.5 = 40. Then n = 40 × 40.
Your average trade
How does +0.25R compare with what luck alone does to the average of 64 trades?
Lesson done
A sample's win rate or average trade is the true value plus luck, and the luck shrinks only with the square root of the sample size: four times the trades, half the luck. Ten trades can show almost anything, and even an edge as big as 60% against 50% needs a few hundred before one sample can tell it from a coin.
Key ideas
- Sample
- the trades you happened to get, standing in for all the trades a strategy could make
- Sample size (n)
- the number of trades in a sample
- Law of large numbers
- as trades add up, what a sample measures (a win rate, an average trade) settles toward the true value
- Band
- the range that holds the middle 95 in 100 samples' results
- Margin of error
- how far either side of the true value the results of about 95 samples in 100 land; for a win rate, about 100 ÷ √n points
- Point
- one percentage point: 40% to 50% is 10 points
Formulas
σaverage = σ ÷ √n · win-rate band ≈ p ± 100 ÷ √n points
About 68 samples in 100 land within one σaverage of the true value, about 95 within two. Four times the trades, half the luck.