Backtest Metrics
In the previous lesson we learnt what a backtest is: a simulation over past data. Let's talk about how it helps us make a decision.
A backtest is supposed to hand us a scorecard on a strategy, the way a student gets a report card. The results are usually not as easy to read as a report card.
Reading a backtest is quite similar to deciding who is a good cricketer or basketball player. Let's take it from a batsman's point of view.
A batsman with a good average across a career is generally a better batsman than one with a lower average, because the higher average means he has scored more runs per attempt. A basketball player who scores more points per game is generally the better player, for the same reason.
In a backtest, the average return of the strategy is the same idea. It is the average percentage the strategy made per trade in the past.
Now consider tennis. The player who wins the most matches is generally the better player.
In a backtest, that number is the win rate. A higher win rate generally means a better strategy.
So with two sports examples we already have two of the most important backtest metrics:
- The average return of a strategy
- The win rate of a strategy
The third number: how much you risk to make it
Neither number above says anything about the size of the wins compared with the size of the losses. That is the third number.
First, one piece of vocabulary this whole course leans on. R is one unit of risk: the distance from your entry to your stop loss. If your stop sits 1% below your entry, then 1R is 1%. Measuring in R rather than in dollars lets you compare a trade on a $30 stock with a trade on a $600 stock on the same scale.
The risk to reward ratio says how far your target is compared with your stop, measured in R.
If your target is 2% away and your stop is 1% away, you are risking 1 to make 2. You will see that written as 1:2, and the single number we use in the formulas below is the reward side of it: R = 2.
You want this number as high as you can get it. But push it too high and your target sits so far away that price rarely reaches it, and your win rate collapses. The two numbers pull against each other, which is exactly why neither means much on its own.
Putting the three together
Assume a strategy has a win rate of 50%, a target of 2% and a stop loss of 1%. On average you can expect it to make 0.5% per trade. Here is where that comes from.
Say you run the strategy 10 times, putting $100 in every time. With a 50% win rate, 5 trades win and 5 trades lose.
- The 5 winners make 2% each: +2 +2 +2 +2 +2 = +10%
- The 5 losers cost 1% each: −1 −1 −1 −1 −1 = −5%
That leaves +5% across 10 trades, which is +0.5% per trade.
Written as a formula:
Average return per trade = (win rate × target%) − (loss rate × stop loss%)
= (0.50 × 2%) − (0.50 × 1%)
= 1.0% − 0.5%
= 0.5%
The same thing in R, which is the form worth memorising because it drops the percentages entirely:
Expectancy in R = (win rate × R) − (1 − win rate)
= (0.50 × 2) − (0.50)
= 0.5R
Both come out at 0.5, and in this example 0.5R happens to equal 0.5% because the stop loss is 1%, so 1R is 1%. Keep the two apart in your head. R is a multiple of your risk; a percentage is a move in the price. They only look identical when the stop happens to be exactly 1%.
That average, in R, is the strategy's expectancy. For a strategy to be worth trading, it has to be positive.
The system with the higher win rate isn't always the one that compounds. Watch what changes when you trade win rate for R.
A strategy that loses more often than it wins
Here is where it gets interesting. Consider a strategy with a 40% win rate and R of 3:
Expectancy = (0.40 × 3) − (0.60)
= 1.2 − 0.6
= 0.6R
That is better than the 50% strategy above, even though it loses six trades out of every ten.
Many combinations of win rate and R make a profitable strategy. Our job as traders is to find them and use them.
The one real drawback of the second strategy is human. It wins less often, so it is psychologically harder to keep faith in, even though the numbers are not lying to you. Most traders abandon a strategy like that during an ordinary run of losers and never find out it was the better one.
The break-even line
There is a clean way to know the minimum win rate a strategy needs before it makes any money at all:
Break-even win rate = 1 / (R + 1) × 100
- If R is 1, then 1/2 × 100 = 50%. You need to win more than half the time.
- If R is 2, then 1/3 × 100 = 33.3%. Anything above a third and you are profitable.
- If R is 3, then 1/4 × 100 = 25%.
The higher your reward compared with your risk, the more often you are allowed to be wrong.
That is the whole trade-off in one line, and it is why "what is a good win rate?" is the wrong first question.
Overall, the market is a game of uncertainty, and all we can do is manage it based on what we have already seen. In the next lesson we look at the metrics that tell you whether what you have seen is worth believing.