Introduction to Quant Finance · Lesson 7
Returns, three ways
A result means little until you fix its unit. Percent, log return and R: what each one counts, and when to use it.
Know the basics? Read the lesson notesWho did better?
A trade is one buy and the sell that closes it. Two friends each post the result of one trade. The first made $300. The second made $200. Who did better?
+50%, then −50%
Percent fixes the size problem. Now a second problem, about time. An account starts at $10,000, and each trade puts in the whole account. The first trade makes +50%. The second loses 50%. Where does the account end?
Run the two trades
Press each trade, in either order. The bars show what the account holds after each one.
An account of $10,000 and two trades (made-up numbers)
Each bar is the account after a trade. Dashed: the $10,000 start.
+50% and −50% add up to 0%, yet the account ends at $7,500: 25% down.
Each percent applies to what the account holds at that moment. The +50% trade multiplies the account by 1.5, the −50% trade by 0.5, and 1.5 × 0.5 = 0.75, in either order. That multiplier, new ÷ old, is called the growth factor. Percent returns over time multiply; adding them gives the wrong answer.
A unit that adds up: the ln key
It would help to count returns in a unit that simply adds up over time. There is one. Every scientific calculator and spreadsheet has a key called ln, the natural logarithm. You don't need to know how it works inside, only what it does: it turns multiplying into adding. For any two numbers above zero, a and b: ln(a × b) = ln(a) + ln(b).
Growth factors multiply (1.5 × 0.5), and ln turns a product into a sum, so the ln of each factor can simply be added. The log return of a trade is ln of its growth factor. Tap each number to put it in the calculator, then press ln: (the +50% trade), (the −50% trade) and (both together).
ln(1.5) + ln(0.5) = 0.405 + (−0.693) = −0.288, which is ln(0.75). The two trades' log returns add up to the log return of both together.
Log returns are written as plain decimals (0.405, not a percent), so they don't get mixed up with percents. To turn one back into a growth factor, use the key that undoes ln, eˣ: type −0.288 and press eˣ, and you get 0.75, which is 25% down.
Drag the end of a price path
Here is a made-up price over five days. Each day has a percent return and a log return (ln of that day's price ÷ the day before's). Drag the end of the line, or use the slider: first until the five daily percents add up to 0.0%, then until the five daily logs add up to 0.000.
A made-up price, five days (simulated)
Dashed: the $100 start. Drag the orange end point.
| Day 1 | Day 2 | Day 3 | Day 4 | Day 5 | |
|---|---|---|---|---|---|
| Percent | |||||
| Log |
The percents added up to 0.0% with the price at $99.30, below the $100 start. The logs added up to 0.000 with the price at $100.00, exactly back at the start. Daily log returns always add up to the log return from start to end; daily percents don't.
The gap is small here because each day moves only a few percent, and for small moves the two are nearly equal (day 1: −0.0513 as a percent return, −0.0527 as a log return). Big moves, like +50% and −50%, pull them far apart.
R: a result in units of risk
Percent says what a trade did to the account. It doesn't say how much the trade put at risk to get there. Many traders decide, before they buy, the price at which they'll sell if the trade goes wrong. That price is the stop. The money lost if the price falls to the stop is the trade's risk.
R counts a result in units of that risk: result ÷ risk. A trade that risked $400 and made $1,200 made 1,200 ÷ 400 = +3R. One that fell to its stop lost exactly its risk: −1R.
This trade bought 200 shares (small pieces of a company) at $50 each, the whole $10,000 account, and sold them 8 days later at $56. Drag the stop line and make this same trade worth exactly +2R.
One made-up trade, 8 days (simulated)
Dashed: the $50 buy. Orange line: the stop. Shaded: the risk, from the buy down to the stop.
Stop at $47: the risk is 200 × ($50 − $47) = $600, and $1,200 ÷ $600 = +2R.
Moving the stop changed only R. The result, $1,200 or +12% of the account ($1,200 ÷ $10,000), stays put, because the trade itself didn't change. R is the one unit of the three that asks how much was at risk. That makes it honest only when the stop was set before the buy: a stop picked afterwards can make any winning trade look like many R.
Two backtests, two sizes
A backtest replays a trading rule on past prices to see what it would have made. Two backtests each ran 100 trades. The first risked $50 a trade and made $1,500 in total. The second risked $500 a trade and made $5,000. Which rule did more with what it risked?
Simple returns multiply, log returns add
The percent return has a textbook name: the simple return. Over time, simple returns combine by multiplying their growth factors; log returns combine by adding. The reason: the growth factor from the first price to the last is the product of each period's factor, Pn ÷ P0 = (P1 ÷ P0) × (P2 ÷ P1) × … × (Pn ÷ Pn−1), because the prices in between cancel. ln turns that product into a sum.
- P0, P1
- the price, or the account, at the start and at the end of one period (a day, or a trade)
- P1 ÷ P0
- the growth factor of that period
- r
- the simple return, as a decimal: 0.5 is +50%
- ℓ
- the log return of one period (ℓ is a handwritten l, for log). For small moves ℓ ≈ r: a +1% day (r = 0.01) has ℓ = 0.00995
- ln
- the natural logarithm: the ln key
- ℓ1 … ℓn
- the log returns of n periods in a row
- ℓtotal
- the log return from the first price, P0, to the last, Pn
- ex
- the eˣ key, which undoes ln (e is a fixed number, about 2.718)
Simple returns: r1 = 1.5 − 1 = +0.5 and r2 = 0.5 − 1 = −0.5. They add up to 0, but the growth factors multiply: 1.5 × 0.5 = 0.75.
Log returns: ℓ1 = ln(1.5) = 0.405 and ℓ2 = ln(0.5) = −0.693, so ℓtotal = 0.405 − 0.693 = −0.288. Back: r = e−0.288 − 1 = 0.75 − 1 = −0.25. The account ended at 0.75 × $10,000 = $7,500, a simple return of −25%.
- nothing is paid into or taken out of the account between the start and the end (a deposit would look like a gain);
- prices stay above zero: there is no ln of zero, so a log return can't describe losing everything.
Log returns add over time, not across things held side by side: if you split money between two things (say, two stocks), the account's return is the weighted average of their percent returns (the plain average if the split is even), not of their log returns (lesson C11, Diversification). Averages of simple returns over time overstate growth when the returns swing a lot (lesson A14, Compounding and the asymmetry of losses).
Try it on new numbers, with the ln key below. A price goes from $40 to $50, then to $45. What is its log return from $40 to $45?
The R-multiple
A result counted in units of the risk set before the trade is called an R-multiple. For a buy with its stop below the buy price:
- N
- the number of shares bought
- Pbuy
- the buy price
- Pstop
- the stop: the price at which the trade will sell if it goes wrong
- risk
- the dollars lost if the price falls to the stop and the trade sells there
- result
- what the trade made or lost in dollars: what came back minus what went in
- result in R
- the R-multiple: +2R made twice the risk; −1R lost exactly the risk
Risk = 200 × ($50 − $47) = $600. Result = 200 × ($56 − $50) = $1,200. Result in R = 1,200 ÷ 600 = +2R. With the stop at $48, the risk is $400 and the same trade is +3R.
Back to dollars: +2R × $600 = $1,200.
- the stop is set before the buy and isn't moved afterwards;
- the trade really sells at the stop price when the price reaches it;
- risk is counted the same way on every trade.
A price can jump past the stop, overnight or on news, and the trade sells lower: a loss bigger than 1R (lesson A13, Orders: market, limit and stop). Trading costs add to every loss (lesson A16, Costs).
Try it on new numbers. You buy 300 shares at $20 with a stop at $19, and sell at $23.50. What is the result in R?
What this means for your backtest
A backtest reports results. Before you compare two of them, check which unit each one is in. Turn over the three units one at a time.
- To compare trades of different sizes, use percent of the account.
$300 is 3% of $10,000 and 10% of $2,000. Dollars only compare when the same amount went in.
- To add returns up over time, add log returns.
Percents multiply: +50% then −50% is −25%, not 0. Logs add: 0.405 − 0.693 = −0.288, and eˣ turns that back into 0.75, or −25%. A tally that adds up daily percents is off, by more the bigger the moves.
- To compare rules with different stops or sizes, count in R.
R divides out the risk: 30R over 100 trades beats 10R over 100 trades, whatever the dollars. The average result per trade (lesson A1) and many later lessons count in R.
Whichever unit you use, say which one. "+12" means nothing until you know whether it's $12, 12%, a log return of 0.12 or 12R.
"I'm back to even"
Use the ln key below. What is the account's log return over the two trades? If they were back to even, it would be 0.000.
Hint: the growth factors are 1.2 (+20%) and 0.8 (−20%). Take ln of each and add them up.
"+12R last month"
By what percent did that account grow last month? Type it in percent.
Hint: R × the risk per trade gives dollars. Dollars ÷ the account gives the percent.
A year in a spreadsheet
Is +20% the year's return?
Lesson done
A result means little until you fix its unit. Percent of the account compares trades of different sizes. Log returns add up over time, where percents multiply. R measures a result against what the trade risked. Whichever you use, say which.
Key ideas
- Simple (percent) return
- the change as a share of the start: new ÷ old − 1
- Growth factor
- new ÷ old: what the account is multiplied by (1.5 for +50%)
- Log return
- ln of the growth factor; log returns add up over time
- ln and eˣ
- the natural logarithm, which turns multiplying into adding, and the key that undoes it
- Stop
- the price, set before the buy, at which a trade sells if it goes wrong
- Risk
- the dollars lost if the price falls to the stop
- R (R-multiple)
- a result in units of its risk: result ÷ risk
Formulas
r = P1 ÷ P0 − 1 · ℓ = ln(P1 ÷ P0) · r = eℓ − 1
ℓtotal = ℓ1 + … + ℓn · Pn ÷ P0 = eℓtotal
risk = N × (Pbuy − Pstop) · result in R = result ÷ risk · result = result in R × risk