Quant from Scratch by QuantWright

Introduction to Quant Finance · Lesson 14

Compounding and the asymmetry of losses

Why a 50% loss needs a 100% gain to get back, and why big swings cost growth even when the average return stays the same.

Know the basics? Read the lesson notes

Down 50%, then back up

Last lesson: a percent return is the change as a share of where you started (€100 to €110 is +10%). This lesson uses only that.

Here is a made-up account with €100 in it. It falls 50%. Press the button, then drag the gain up until the account is back at €100.

One made-up account

Grey: what's left after the fall. Colour: what the gain adds back. Dashed: the €100 start.

Account€100
Fall–
Gain, measured on €50–

On the way, a gain of 50% only took the account to €75, because 50% of €50 is €25. Getting back took +100%: the account needed €50 more, and €50 is all of what was left.

A gain is measured on what you have now, and after a fall that's less than you started with.

Guess first: 30% and 80%

A 50% fall needed a 100% gain. Now picture two other accounts, each starting at €100. One falls 30%, the other falls 80%. What gain gets each one back to €100?

Keep your guess in mind. On the next screen you try every fall from 0% to 80%.

Every fall, and the gain back

Slide the fall from 0% to 80%. The curve is the gain that gets the account back to €100. The dashed line is what you'd need if gains and losses were symmetric: a gain the same size as the fall.

The gain that undoes a fall

Across: the fall. Up: the gain needed to get back to the start. Dashed: a gain the same size as the fall.

Left of the €100€100
Needed to get back€0
As a gain on what's left+0%

The reason is the same as before: the gain is measured on what's left. After a 30% fall you have €70 and need €30 more, and 30 ÷ 70 is about 0.43, so +43%. After an 80% fall you have €20 and need €80 more, which is four times €20: +400%.

Small falls need a little more than the fall. Big ones need far more, and the curve shoots up as the fall nears 100%.

Up 10%, down 10%

Here is an account that goes up 10% one month and down 10% the next, over and over. Its average return, all the monthly returns added up and divided by the number of months, is (+10% − 10%) ÷ 2 = 0% a month. Does it stay at €100? Step through 20 months.

Up 10%, down 10%, for 20 months (made up)

The account in euros, one dot per month. Dashed: the €100 start.

Month0 of 20
This month–
Average return so far–
Account€100.00

Each up-and-down pair ends lower: €100 → €110 → €99. The up month added 10% of €100, which is €10. The down month took 10% of €110, which is €11. So every pair leaves the account 1% lower.

After 20 months it's at €90.44, though its average return was 0% a month.

Same average, different swings

Now two made-up accounts that both average +1% a month for ten years, which is 120 months. Steady makes exactly +1% every month. Swingy makes +16% in half its months and −14% in the other half, which also averages +1%: (16 − 14) ÷ 2 = 1.

Steady ends at €330: €100 multiplied by 1.01, 120 times over. Where does Swingy end?

Keep your guess in mind. On the next screen you set the swings yourself.

Turn up the swings

Both accounts average +1% a month. The slider sets Swingy's swing: how far each month's return sits from that average, up or down. At ±10%, Swingy's months are +11% or −9%. Swingy always has 60 up months and 60 down months, in an order shuffled at random. Slide from ±0% to ±20%.

Two made-up accounts, both averaging +1% a month

The account in euros over 120 months. Grey: Steady. Colour: Swingy, with the swing you set.

Swingy's months+1% each
Average a month, both+1%
Steady ends€330
Swingy ends€330

Take one up month and one down month together: they multiply the account by 1.16 × 0.86 = 0.9976, a little under 1. Swingy has 60 of each, so €100 gets multiplied by 0.9976 sixty times, and that leaves €87. Bigger swings cost more: at ±10% Swingy ends at €183, at ±20% at €30.

Was Swingy unlucky?

Maybe its down months just came at bad times. Keep the swing at ±15% and replay the same 60 up months and 60 down months in a different random order.

Swingy at ±15%: the same months, shuffled

Each line is one order of the same 60 months of +16% and 60 of −14%. Earlier orders stay in grey.

Order1 of 6
Highest point–
Ends at–

The path changes a lot: the second order climbs to €559 before it falls back. But every order ends at €86.57, the €87 from before. Multiplying gives the same answer in any order (1.16 × 0.86 is the same as 0.86 × 1.16), so the order of the months can't change the end.

The shortfall isn't bad luck. It comes from the swings themselves, and it has a name: volatility drag. Volatility is the finance word for how much returns swing.

Theory

Returns multiply: compounding

Each period's return (each month's, in this lesson) multiplies the account: +10% multiplies it by 1.10, a 10% fall by 0.90. Over many periods the multipliers multiply together. This is compounding, and the result over all the periods is the compound return.

A fall works the same way. A fall of L leaves 1 − L of the account. To get back, the gain G has to turn that into the whole account again: (1 − L) × (1 + G) = 1. Divide both sides by (1 − L), then subtract 1: that gives the third line below.

end = start × (1 + r1) × (1 + r2) × … × (1 + rn)
compound return = (1 + r1) × … × (1 + rn) − 1
G = 1 ÷ (1 − L) − 1
r1 … rn
each period's return as a decimal: +10% is 0.10, a 10% fall is −0.10
n
the number of periods (months, here)
L
the fall, as a decimal: a 30% fall is 0.30
G
the gain that gets back to the start, as a decimal: 1.00 is +100%
Worked example: your accounts

The 80% fall: G = 1 ÷ (1 − 0.80) − 1 = 1 ÷ 0.20 − 1 = 5 − 1 = 4, which is +400%.

Up 10%, down 10%: €100 × 1.10 × 0.90 = €99. Twenty months is ten such pairs: €100 × 0.99 × 0.99 × … ten times = €90.44, a compound return of 0.9044 − 1 = −0.0956, about −9.6%.

Holds when
  • each return is a return on the whole account, measured from where it stood at the start of that period;
  • no money is added or taken out along the way;
  • costs are already taken out of each return.
Breaks when

Money goes in or out between periods: then the same returns apply to different amounts, and the product no longer gives the end (lesson D9, Portfolio accounting).

Try it on new numbers. An account falls 60%. What gain gets it back to where it started? Type a percentage.

G = 1 ÷ (1 − 0.60) − 1 = 1 ÷ 0.40 − 1 = 2.5 − 1 = 1.5, which is +150%. Check: €100 falls to €40, and €40 × 2.5 = €100.
A 60% fall leaves 0.40 of the account. G = 1 ÷ 0.40 − 1 = 2.5 − 1 = 1.5, which is +150%: €40 has to grow by €60, and €60 is 1.5 times €40.
Theory

Swings cost growth: volatility drag

The plain average of the returns is the arithmetic mean. The rate the account actually grew at is a different number: the steady return per period that would reach the same end. That is the geometric mean, also called the compound growth rate: the first line below. Steady's is +1% a month.

Swings pull the geometric mean below the arithmetic mean, and the gap is the volatility drag. Here is why, around an average of 0: up by s then down by s multiplies the account by (1 + s) × (1 − s) = 1 − s2. So each up-and-down pair loses about s2, and each period about half that. Hence a rule of thumb, the second line:

g = (end ÷ start)1 ÷ n − 1
g ≈ a − s2 ÷ 2
g
the geometric mean: the growth per period you actually get
end ÷ start
how many times the account multiplied over all n periods
1 ÷ n
the n-th root: the number that, multiplied by itself n times, gives end ÷ start (on a calculator, the x^y key with y = 1 ÷ n)
a
the arithmetic mean: the plain average return per period
s
the swing: how far a typical period's return sits from the average (for Swingy, exactly ±s every month). Its textbook name is the standard deviation (lesson A8, Volatility)
s2
s multiplied by itself
≈
about equal: the rule is an approximation, close when the swings are small
Worked example: Swingy

At ±15%, from the end: (86.57 ÷ 100)1 ÷ 120 − 1 ≈ −0.0012, which is −0.12% a month. The same from one pair: an up month and a down month multiply by 1.16 × 0.86 = 0.9976, so one month is about 0.9988, its square root (0.9988 × 0.9988 = 0.9976): −0.12% a month. The rule of thumb: 0.01 − 0.15 × 0.15 ÷ 2 = 0.01 − 0.01125 = −0.00125, about −0.13%.

At ±10%: a = 0.01 and s = 0.10, so g ≈ 0.01 − 0.10 × 0.10 ÷ 2 = 0.01 − 0.005 = 0.005: +0.5% a month, half of Steady's. Exact: a pair multiplies by 1.11 × 0.91 = 1.0101, so one month is about 1.0050, its square root: +0.50%.

Up 10%, down 10%: 0 − 0.10 × 0.10 ÷ 2 = −0.005, so −0.5% a month, about −1% every two months, as you saw.

The swing counts squared: double it, from ±10% to ±20%, and the drag goes from 0.5% to 2% a month, four times as much.

Holds when
  • the swings are small next to 100%: up to about ±20% a period the rule is close (at ±50% around an average of 0, it says −12.5% a period where the exact answer is −13.4%);
  • each return is compounded on the whole account, as in the first theory card.
Breaks when

Returns are lopsided, such as rare deep crashes among many small gains: then the swing alone understates the damage (lesson A6, Fat tails).

A trading strategy (a rule that decides when to trade) averages +3% a month, and its monthly returns swing about ±20% around that. Roughly what does the account grow at per month?

+3% is the arithmetic mean. The swings take some of it away: 0.03 − 0.20 × 0.20 ÷ 2 = 0.03 − 0.02 = 0.01, about +1% a month.
g ≈ 0.03 − 0.20 × 0.20 ÷ 2 = 0.03 − 0.02 = 0.01: about +1% a month (exact: +1.04%). Two thirds of the average is lost to the swings.
−1% comes from forgetting to halve. The drag is 0.20 × 0.20 ÷ 2 = 0.02, so 0.03 − 0.02 = 0.01: about +1% a month.

What this means for your backtest

A backtest runs a trading strategy over past prices to see what it would have made. Three habits follow from this lesson. Turn them over one at a time.

  1. Read the worst fall with the climb back in mind.

    A backtest that once fell 50% needed +100% just to get back. Find its deepest fall from a high point, called the maximum drawdown (lesson A17), and work out the gain that undid it.

Practice 1 of 3

"One good year and you're back"

The situationA course seller shows a strategy that lost 40% in its worst year. "Nothing to worry about," they say. "One year of +40% and you're back."

What gain does the account actually need to get back to where it was? Type a percentage.

Hint: a 40% fall leaves 0.60 of the account. The gain back is 1 ÷ 0.60 − 1.

1 ÷ 0.60 − 1 = 1.667 − 1 = 0.667: about +67%. €100 falls to €60, and €60 needs €40 more, which is two thirds of €60.
A 40% fall leaves €60 of €100. Getting back means adding €40, and €40 is two thirds of €60: about +67%. A +40% year takes €60 only to €84.
Practice 2 of 3

Two backtests, two averages

The situationA friend shows two backtests over the same ten years. Strategy A averages +1.5% a month, and its months swing about ±5% around that. Strategy B averages +2.5% a month, with swings of about ±20%. The friend prefers B for its higher average.

Using the rule of thumb, which account grew faster?

A: 0.015 − 0.05 × 0.05 ÷ 2 = 0.015 − 0.00125, about +1.4% a month. B: 0.025 − 0.20 × 0.20 ÷ 2 = 0.025 − 0.02 = 0.005, about +0.5% a month. B's higher average grew the account about a third as fast.
The average isn't the growth. B's swings cost 0.20 × 0.20 ÷ 2 = 0.02 a month, most of its 0.025 average, so it grows about 0.5% a month. A's swings cost only 0.00125, so it grows about 1.4%.
The swings decide it. A loses only 0.05 × 0.05 ÷ 2 = 0.00125 a month to the drag and grows about 1.4%. B loses 0.20 × 0.20 ÷ 2 = 0.02 of its 0.025 and grows about 0.5%.
Practice 3 of 3

Up 25%, down 20%

The situationA friend's account rose 25% last year and fell 20% this year. "That's an average of +2.5% a year," they say, "so I'm ahead."

Where is the account now, compared with two years ago?

Adding +25% and −20% gives +5%, but returns multiply: 1.25 × 0.80 = 1.00. The account is exactly where it started.
+2.5% a year is the arithmetic mean. The growth comes from multiplying: 1.25 × 0.80 = 1.00, so the account is exactly back where it started, a geometric mean of 0%.
1.25 × 0.80 = 1.00. €100 becomes €125, then loses 20% of €125, which is €25: back to €100. The average return is +2.5% a year; the growth is 0%.
✓

Lesson done

Returns multiply, so a loss and a gain of the same size don't cancel: after a fall, the gain is measured on less money, so it has to be bigger (−50% needs +100%). For the same reason, swings pull growth down even when the average return stays the same. To judge an account, look at how it actually compounded, not at its average return.

Key ideas

Percent return
the change as a share of where the period started
Compounding
each return multiplies the account, so returns multiply over time rather than add up
Arithmetic mean
the plain average of the returns
Geometric mean
the steady return per period that reaches the same end: the growth you actually got (also: compound growth rate)
Swing
how far a typical return sits from the average; its textbook name is the standard deviation (lesson A8)
Volatility drag
the gap between the arithmetic and the geometric mean, caused by the swings

Formulas

end = start × (1 + r1) × … × (1 + rn)  ·  G = 1 ÷ (1 − L) − 1

g = (end ÷ start)1 ÷ n − 1  ·  g ≈ a − s2 ÷ 2

Falls of 30%, 50% and 80% need gains of about 43%, 100% and 400% to get back.

Lesson notes

Returns multiply. A loss and a gain of the same size do not cancel, because the gain is measured on a smaller account: a fall of 50% needs a gain of 100% to get back. For the same reason, swings in the returns pull an account's growth below its average return, even when the average stays the same.

A gain is measured on what is left

A made-up account holds €100 and falls 50%, so €50 is left. A gain of 50% adds 50% of €50, which is €25, and takes the account only to €75. To get back to €100 it needs €50 more, and €50 is all of what is left: a gain of +100%.

Every fall, and the gain back

The same reasoning works for any fall. After a 30% fall you have €70 and need €30 more. 30 ÷ 70 is about 0.43, so the gain is +43%. After an 80% fall you have €20 and need €80 more, which is four times €20: +400%. Small falls need a little more than the fall. Big ones need far more, and the gain needed climbs steeply as the fall nears 100%.

Up 10%, down 10%

The average return is the monthly returns added up and divided by the number of months. An account that goes up 10% one month and down 10% the next averages (+10% − 10%) ÷ 2 = 0%, but it does not stay put. The up month adds 10% of €100, which is €10, and makes €110. The down month takes 10% of €110, which is €11, and leaves €99. After 20 months (ten pairs) it holds €90.44, though its average was 0% a month.

Same average, different swings

Two made-up accounts both average +1% a month for 120 months (ten years). Steady makes exactly +1% every month and ends at €330: €100 multiplied by 1.01, 120 times. Swingy makes +16% in 60 months and −14% in the other 60, which also averages (16 − 14) ÷ 2 = 1%. Its swing, how far each month sits from that average, is 15 points up or down.

One up month and one down month multiply the account by 1.16 × 0.86 = 0.9976, a little under 1. Swingy has 60 of each, so €100 is multiplied by 0.9976 sixty times, and that leaves €86.57, about €87. Bigger swings cost more: at ±10% (months of +11% and −9%) Swingy ends at €183, and at ±20% (months of +21% and −19%) at €30.

The order of the months does not matter

Perhaps Swingy was unlucky, and its down months came at bad times. In the lesson's simulation, the same 60 up months and 60 down months were replayed in 6 random orders. The paths differed a lot on the way: one climbed above €500 before it fell back. But all six ended at €86.57, because multiplying gives the same answer in any order. The shortfall is not bad luck. It comes from the swings, and it is called volatility drag.

Formula: compounding and the gain that undoes a fall

end = start × (1 + r1) × (1 + r2) × … × (1 + rn)
compound return = (1 + r1) × … × (1 + rn) − 1
G = 1 ÷ (1 − L) − 1
r1 … rn
each period's return as a decimal: +10% is 0.10, a 10% fall is −0.10
n
the number of periods (months, here)
L
the fall, as a decimal: a 30% fall is 0.30
G
the gain that gets back to the start, as a decimal: 1.00 is +100%
Worked example: your accounts

The 80% fall: G = 1 ÷ (1 − 0.80) − 1 = 1 ÷ 0.20 − 1 = 5 − 1 = 4, which is +400%.

Up 10%, down 10%: €100 × 1.10 × 0.90 = €99. Twenty months is ten such pairs: €100 × 0.99 × 0.99 × … ten times = €90.44, a compound return of 0.9044 − 1 = −0.0956, about −9.6%.

Holds whenBreaks when

Money goes in or out between periods: then the same returns apply to different amounts, and the product no longer gives the end (lesson D9, Portfolio accounting).

Formula: the geometric mean and volatility drag

The plain average of the returns is the arithmetic mean. The geometric mean is the steady return per period that would reach the same end: the rate the account actually grew at. The gap between the two is the volatility drag. Around an average of 0, up by s then down by s multiplies the account by (1 + s) × (1 − s) = 1 − s2, so each pair loses about s2 and each period about s2 ÷ 2.

g = (end ÷ start)1 ÷ n − 1
g ≈ a − s2 ÷ 2
g
the geometric mean: the growth per period you actually get
end ÷ start
how many times the account multiplied over all n periods
1 ÷ n
the n-th root: the number that, multiplied by itself n times, gives end ÷ start (on a calculator, the x^y key with y = 1 ÷ n)
a
the arithmetic mean: the plain average return per period
s
the swing: how far a typical period's return sits from the average (for Swingy, exactly ±s every month). Its textbook name is the standard deviation (lesson A8, Volatility)
s2
s multiplied by itself
≈
about equal: the rule is an approximation, close when the swings are small
Worked example: Swingy

At ±15%, from the end: (86.57 ÷ 100)1 ÷ 120 − 1 ≈ −0.0012, which is −0.12% a month. The same from one pair: an up month and a down month multiply by 1.16 × 0.86 = 0.9976, so one month is about 0.9988, its square root (0.9988 × 0.9988 = 0.9976): −0.12% a month. The rule of thumb: 0.01 − 0.15 × 0.15 ÷ 2 = 0.01 − 0.01125 = −0.00125, about −0.13%.

At ±10%: a = 0.01 and s = 0.10, so g ≈ 0.01 − 0.10 × 0.10 ÷ 2 = 0.01 − 0.005 = 0.005: +0.5% a month, half of Steady's. Exact: a pair multiplies by 1.11 × 0.91 = 1.0101, so one month is about 1.0050, its square root: +0.50%.

Up 10%, down 10%: 0 − 0.10 × 0.10 ÷ 2 = −0.005, so −0.5% a month, about −1% every two months: the 1% a pair lost in the notes above.

The swing counts squared: double it, from ±10% to ±20%, and the drag goes from 0.5% to 2% a month, four times as much.

Holds whenBreaks when

Returns are lopsided, such as rare deep crashes among many small gains: then the swing alone understates the damage (lesson A6, Fat tails).

One more worked example

New made-up numbers

An account averages +2% a month with a swing of ±10%, so its months are +12% and −8%.

Rule of thumb: g ≈ 0.02 − 0.10 × 0.10 ÷ 2 = 0.02 − 0.005 = 0.015, about +1.5% a month.

Exact: a pair of months multiplies the account by 1.12 × 0.92 = 1.0304. One month is its square root, about 1.0151, because 1.0151 × 1.0151 ≈ 1.0304. That is +1.5% a month, against an average of +2%.

Common mistakes

Check yourself

  1. An account falls 20%. What gain gets it back to where it started?
    Answer

    G = 1 ÷ 0.80 − 1 = 1.25 − 1 = 0.25, which is +25%. Check: €80 + 25% of €80 (€20) = €100.

  2. An account rises 25% one year and falls 20% the next. Where is it, compared with the start?
    Answer

    1.25 × 0.80 = 1.00: exactly where it started.

  3. A strategy averages +3% a month with a swing of ±10%. About what does the account grow at per month?
    Answer

    g ≈ 0.03 − 0.10 × 0.10 ÷ 2 = 0.03 − 0.005 = 0.025: about +2.5% a month.

  4. Why can't the order of the months explain Swingy's €87?
    Answer

    Multiplying gives the same result in any order, and every shuffle of the 60 up and 60 down months ended at €86.57.

Try it yourself

Run the simulation. Every number in this lesson comes from one Python script with a fixed random seed (below). Change the average, the swing or the number of months and see what moves.

Compound by hand. A calculator is enough: type 100, then × 1.16 × 0.86, and repeat. In a spreadsheet, put the monthly returns as decimals in column A, 100 in cell B1, =B1*(1+A1) in B2 (pointing at the return for that month), and copy it down: the last cell is the end. The average of column A is the arithmetic mean; (end ÷ start) raised to the power 1 ÷ n, minus 1, is the geometric mean.

The code behind every number (Python, seed 2026110905)
Loading…

Going further: the average account and the typical account

Swingy had exactly 60 up months and 60 down months. Real months come at random. So give 10,000 made-up accounts 120 months each, where every month a fair coin decides +16% or −14%. The average month is still +1%.

The average end across all 10,000 accounts is €327, close to Steady's €330. But the middle account, the one with half the accounts above it and half below, ends at €87, and 54% of the accounts end below the €100 they started with. A few very lucky accounts pull the average up: the top 1% hold 23% of all the money.

The average across many accounts grows at the arithmetic mean. Any one account grows at its own geometric mean, which the swings pull down. You only get to live through one account, so the geometric mean is the one that describes your result. This gap between the average over many and the path of one is studied under the name ergodicity.

For the preciseGeometric mean: g = ((1 + r1) × … × (1 + rn))1/n − 1. With the log returns of the last lesson, ln(1 + g) is exactly the average log return. The rule of thumb comes from ln(1 + r) ≈ r − r2 ÷ 2 for small r; averaging gives about a − (s2 + a2) ÷ 2, and turning the average log back into a return adds back about a2 ÷ 2, which leaves a − s2 ÷ 2. For Swingy it is exact in closed form: (1 + g)2 = (1 + a)2 − s2. With a = 1%: ±5% gives +0.876% a month (rule +0.875%), ±10% gives +0.504% (rule +0.5%), ±15% gives −0.120% (rule −0.125%), ±20% gives −1.000% (rule −1.0%). Ends after 120 months: Steady €330.04; Swingy €182.75 at ±10%, €86.57 at ±15%, €29.94 at ±20%; ±15% is the smallest whole-number swing that ends below €100 (±14% ends at €103.04).
For the precise: the 10,000 accountsEach account ends at €100 × 1.16k × 0.86120 − k, with k up months, k ~ binomial(120, ½). Exact average end: €100 × 1.01120 = €330.04 (simulated: €326.60). An account needs at least 61 up months to end at or above €100, so the exact share below is P(k ≤ 60) = 53.6% (simulated: 54.0%). The middle account has 60 up months: €86.57, the same as Swingy at ±15%.

Honest notes

Where this comes from