Unit 2 · Markets & Instruments — Session 03 of 07

Returns, P&L, Compounding & Leverage

Every number a quant ever reports — a backtest's growth, a fund's Sharpe ratio, a strategy's worst loss — is built from the same handful of return calculations. Get them slightly wrong and you will manufacture performance that doesn't exist, or miss risk that does. This session nails down the arithmetic once, with code and simulations that check every formula against a known truth. The core move: add log returns across time, add simple returns across assets, and never confuse the two.

DURATION 1.5 h + lab LEVEL Foundations TRACKS QR · QT · QD · IND HANDS-ON Leverage on 2,000 simulated paths

2.3.1 One trade, four numbers

The same trade can be described four ways, and each description answers a different question. Mixing them up is the most common arithmetic error in finance.

You buy 200 shares at $100 and sell them at $110. Your broker statement shows a P&L — profit and loss in currency — of $2,000. That number is what pays the rent, but it is useless for comparison: the same trade on 2,000 shares would show ten times as much. So quants almost always work with returns, which divide out the size of the position.

ONE TRADE — BUY 200 @ $100, SELL @ $110 PRICE MOVE $100 → $110 what the market did (size-free, not a return) P&L +$2,000 what you earned — scales with position size SIMPLE RETURN +10.00% adds across ASSETS — use it for portfolios LOG RETURN 0.0953 adds across TIME — use it for compounding Same trade. The question you are answering decides which number you use.
fig 2.3.1 — one trade described four ways: price move, P&L, simple return and log return

The simple return is the percentage change you learned at school: 10.00%. The log return is the natural logarithm of the price ratio: 0.0953. For small moves they are almost identical; for big moves, or over long periods, they diverge — and each has exactly one job it does perfectly.

📌 Key idea — two returns, two jobs

Simple returns add across assets: a portfolio's simple return is exactly the weighted sum of its holdings' simple returns, with the weights set at the start of the period. Log returns add across time: a year's log return is exactly the sum of its daily log returns. Use simple returns to combine positions and log returns to combine periods, and convert between them with r=ln⁡(1+R)r = \ln(1 + R).

🧭 Margin note — an engineer's analogy

Log returns are the decibels of finance. Gains multiply, just as amplifier stages multiply a signal; taking logs turns multiplication into addition, which is why a log-scale chart of wealth shows steady compounding as a straight line (fig 2.3.4).

2.3.2 From prices to a track record

Every performance number — in a backtest, a fund factsheet or your own trading journal — comes out of the same five-step pipeline. Each step has one classic bug.

THE RETURN PIPELINE — every performance number is built this way 1 · PRICES adjusted for splits and dividends 2 · RETURNS simple per asset, per period 3 · AGGREGATE assets: weight simple time: sum log 4 · ANNUALISE mean × 252, volatility × √252 5 · RISK-ADJUST Sharpe ratio, drawdown bug: raw prices bug: pct_change on unsorted dates bug: summing simple returns over time bug: √252 on monthly data bug: forgetting the risk-free rate Each stage is a function you can unit-test — and each has one classic bug, shown in coral.
fig 2.3.2 — the return pipeline, and the classic bug that lives at each stage

Step 1 matters more than it looks: returns must be computed on prices adjusted for splits and dividends, or a 2-for-1 split shows up as a −50% crash. Whether dividends are included is the difference between a price return and a total return — you met both in Session 2.2 — Equities, Indices & ETFs, and Session 4.3 — Corporate Actions, Security Master & Continuous Futures builds the adjustment pipeline properly.

JobUseWhy
Combine positions into a portfolio returnsimple returns, weightedexact, with start-of-period weights: Rp=∑iwiRiR_p = \sum_i w_i R_i
Combine days into a month or a yearlog returns, summedexact: r0→T=∑trtr_{0\to T} = \sum_t r_t
Statistical modelling of one assetlog returns (usually)additive, more symmetric, unbounded below
Report performance to a humansimple returns, compounded"+8% a year" is what people understand
Compare two strategiesexcess returns, risk-adjustedsubtract the risk-free rate first, then divide by risk
💡 Looking ahead

The excess return — your return minus what cash would have paid — is the only return that measures skill. It powers the Sharpe ratio below, the regressions of Session 5.2 — Regression & Inference That Doesn't Lie and every factor model in Unit 7.

2.3.3 The math of returns

A handful of formulas carry the whole course. Read each one in words first.

Simple and log returns

Price PtP_t at the end of period tt, dividend DtD_t paid during it. The simple return is the fractional change in your money; the log return is its natural logarithm:

Rt=Pt+DtPt−1−1,rt=ln⁡(1+Rt)R_t = \frac{P_t + D_t}{P_{t-1}} - 1, \qquad r_t = \ln(1 + R_t)

Aggregating across time and across assets

Over TT periods, simple returns compound (multiply) while log returns add. Across assets with portfolio weights wiw_i, it is the other way round:

1+R0→T=∏t=1T(1+Rt),r0→T=∑t=1Trt,Rp,t=∑iwiRi,t1 + R_{0\to T} = \prod_{t=1}^{T} (1 + R_t), \qquad r_{0\to T} = \sum_{t=1}^{T} r_t, \qquad R_{p,t} = \sum_{i} w_i R_{i,t}

Annualising

If daily returns are uncorrelated, the mean grows with time and the variance grows with time, so volatility grows with the square root of time. With 252 trading days a year, from a daily mean R‾\bar R and daily standard deviation ss:

μann=252R‾,σann=252s,CAGR=(WTW0)1/Y−1\mu_{\text{ann}} = 252\,\bar R, \qquad \sigma_{\text{ann}} = \sqrt{252}\; s, \qquad \text{CAGR} = \left(\frac{W_T}{W_0}\right)^{1/Y} - 1

Here WtW_t is wealth and YY the number of years. The compound annual growth rate (CAGR) is what you actually experienced; μann\mu_{\text{ann}} is the average of what happened each day — and they are not the same number (§2.3.4).

Risk-adjusting

The Sharpe ratio is annualised excess return per unit of annualised volatility. The drawdown at time tt is how far wealth sits below its running peak. Here rf,tr_{f,t} is the risk-free return over the same day:

SR=252𝔼[Rt−rf,t]σ(Rt−rf,t),DDt=Wtmaxτ≤t⁡Wτ−1\SR = \sqrt{252}\;\frac{\E[R_t - r_{f,t}]}{\sigma(R_t - r_{f,t})}, \qquad \mathrm{DD}_t = \frac{W_t}{\max_{\tau \le t} W_\tau} - 1
🧭 Margin note — the √252 comes with a condition

Scaling volatility by 252\sqrt{252} assumes daily returns are uncorrelated. Returns that are positively autocorrelated — hedge funds holding illiquid assets, private credit, real estate, anything marked to model — break this, usually making the annualised Sharpe ratio look better than it is. Session 5.2 — Regression & Inference That Doesn't Lie shows how to correct for it.

2.3.4 Compounding, drag & the asymmetry of losses

Averages lie about compounding. The arithmetic mean of your returns is always higher than the rate at which your money actually grows — and the gap is set by volatility.

Start with the asymmetry. Lose 50%, then gain 50%, and you are down −25%, because the gain applies to a smaller base. The deeper the hole, the steeper the climb out:

LOSS → GAIN NEEDED TO GET BACK TO EVEN (one scale: 1px = 1 percentage point) LOSS GAIN NEEDED −10% +11% −20% +25% −50% +100% −80% +400% Drawn to the same scale: the deeper the loss, the faster the climb back runs away from it.
fig 2.3.3 — the asymmetry of losses, to scale: a 50% loss needs a 100% gain, an 80% loss needs 400%

Averaging hides this. In the lab, twenty years of synthetic prices with a true drift of 8% and volatility of 20% produce an arithmetic mean return of 10.43% a year — but the money compounded at a CAGR of only 8.82%. What compounds is the mean log return gg = 8.45% (the CAGR is eg−1e^{g} - 1), and the gap between the arithmetic mean and the mean log return is volatility drag:

g≈μ−12σ2g \;\approx\; \mu - \tfrac{1}{2}\sigma^2

The lab measures a drag of 1.98% against a predicted σ2/2\sigma^2/2 of 1.98%. Two percentage points a year, every year, just for being volatile.

⚠️ Pitfall — "the average return was 10%, so I made 10% a year"

No — you made the geometric rate. Fund marketing loves the arithmetic mean because it is always the bigger number. When you compare strategies, compare CAGR or mean log returns, and remember that reducing volatility raises growth even when the average return is unchanged.

Also notice the sampling noise: the true drift was 8% but twenty years of data estimated 10.43%. The standard error of a 20-year mean return is about σ/20≈\sigma/\sqrt{20} \approx 4.5%. Mean returns are the hardest thing in finance to estimate — a theme that returns in every unit.

2.3.5 Sharpe & drawdown, in code

The whole pipeline is a dozen lines of pandas. The companion lab uses the quantnb.returns module, but it is worth writing once by hand.

import numpy as np
import quantnb as qn

lab = qn.Lab("2.3")                                       # seeded: same numbers every run
px = qn.synth.gbm_prices(252 * 20, mu=0.08, sigma=0.20, rng=lab.rng)["price"]

r  = px.pct_change().iloc[1:]                          # simple returns
lr = np.log(px / px.shift(1)).iloc[1:]                  # log returns

wealth = (1 + r).cumprod()                             # compound, never sum
cagr   = wealth.iloc[-1] ** (1 / 20) - 1
excess = r - 0.03 / 252                               # 3% risk-free, per day
sharpe = excess.mean() / excess.std() * np.sqrt(252)
dd     = wealth / wealth.cummax() - 1                   # drawdown path, ≤ 0

assert np.isclose(lr.sum(), np.log(px.iloc[-1] / px.iloc[0]))   # log returns add

On the lab's path the numbers are: CAGR 8.82%, volatility 19.90%, Sharpe ratio 0.37 against a 3% risk-free rate, and a maximum drawdown of −44.5%. One dollar became $5.42.

MeasureWhat it answersBlind spot
CAGRHow fast did the money actually grow?Says nothing about the ride
VolatilityHow big are typical swings?Treats upside and downside alike; misses fat tails
Sharpe ratioHow much excess return per unit of risk?Assumes volatility is the right risk; noisy on short samples
Max drawdownWhat is the worst peak-to-trough loss?A single path's worst case — the next one can be worse
💡 Tip — a Sharpe ratio is an estimate, not a fact

A Sharpe ratio of 0.37 over twenty years of daily data has a standard error of roughly 1/Y≈1/\sqrt{Y} \approx 0.22 — you could not rule out zero skill. (You met this 1/√Y rule in Session 1.3; Session 1.4 turns it into how many years you need, and Session 5.2 derives the standard error of the Sharpe ratio properly.) Session 5.2 — Regression & Inference That Doesn't Lie derives this, and Session 6.7 — Overfitting Statistics: PSR, DSR, MinTRL & PBO adds what happens when you tried many strategies before picking this one.

2.3.6 Leverage: when more becomes less

Leverage multiplies both the excess return and the volatility, so it leaves the Sharpe ratio unchanged. It does not leave growth unchanged — and the difference is where accounts go to die.

You have already met leverage in disguise: the "Rocket" of Session 1.2 was a levered market bet that looked like skill until a regression exposed it as beta. Leverage LL means holding LL dollars of exposure for each dollar of capital, borrowing the rest at the risk-free rate. Rebalanced daily, the levered return is Rt(L)=LRt−(L−1)rf,tR^{(L)}_t = L R_t - (L-1)\, r_{f,t}. The mean excess return rises linearly in LL, but the drag rises with L2L^2 (below, μ\mu, rfr_f and σ\sigma are annual):

g(L)=rf+L(μ−rf)−12L2σ2,L⋆=μ−rfσ2g(L) = r_f + L(\mu - r_f) - \tfrac{1}{2}L^2\sigma^2, \qquad L^\star = \frac{\mu - r_f}{\sigma^2}

Growth peaks at L⋆L^\star — here 1.25 — and then falls. Past 2L⋆2L^\star you would grow faster holding cash, and a little further on growth turns negative: a levered position in an asset that goes up on average will, typically, lose money.

GROWTH OF $1 OVER 20 SIMULATED YEARS (LOG SCALE) 1× unlevered 2× daily 3× daily $0.50 $1.00 $2.00 $5.00 0 5 10 15 20 1× unlevered 1× unlevered: $5.42 2× daily 2× daily: $7.31 3× daily 3× daily: $4.46 2× daily: $7.31 1× unlevered: $5.42 3× daily: $4.46
fig 2.3.4 — the same simulated 20-year path held at 1×, 2× and 3× daily leverage (log scale; years on the x-axis)

On this one lucky path, 2× beat 1× (10.5% a year) — at the price of a −74% drawdown. The 3× version compounded at only 7.8% and fell −91.5% from its peak. Few people hold on through a loss like that.

DRAWDOWN OF THE 3× VERSION, BY SIMULATED YEAR −100% −80% −60% −40% −20% 0% 0 5 10 15 20 drawdown worst −91.5%
fig 2.3.5 — the 3× version's drawdown: most of the path is spent far below the previous peak

One path proves nothing, so the lab simulates 2,000 ten-year paths, using the same random shocks at every leverage level so the comparison is fair. The median growth rate traces the theory almost exactly:

MEDIAN COMPOUND GROWTH BY LEVERAGE — 2,000 SIMULATED 10-YEAR PATHS −30.0% −20.0% −10.0% 0.0% 10.0% 20.0% 0.5×: 5.2% 5.2% 0.5× 1×: 6.2% 6.2% 1× 1.5×: 6.3% 6.3% 1.5× 2×: 5.2% 5.2% 2× 3×: 0.2% 0.2% 3× 4×: −8.4% −8.4% 4× 5×: −19.6% −19.6% 5×
fig 2.3.6 — median compound growth by leverage: it peaks near L* and collapses beyond it
LeverageMedian CAGRTheory CAGR, eg(L)−1e^{g(L)} - 1P(losing money over 10 y)P(a 90% drawdown)
1×6.2%6.2%16%0%
2×5.2%5.1%34%6%
3×0.2%0.0%50%42%
5×−19.6%−19.7%77%95%
SAME EDGE, TWO WAYS TO SIZE IT THE NAIVE WAY "Sharpe is the same at 5×, so 5× the return" size from the backtest's best-case volatility Past 2L*, cash beats you; then growth goes negative. At 5× here: shrinking wealth, a 90% drawdown near-certain. THE DISCIPLINED WAY 1 · estimate L* = (μ − r_f)/σ², then assume μ is too high 2 · size well below L*, set by the drawdown you can bear Near-peak growth, far smaller tails. Half of L* keeps 75% of the excess growth at half the volatility.
fig 2.3.7 — two ways to size the same edge: lever the Sharpe, or respect the growth curve
📌 Key idea — leverage is a volatility decision

Because drag grows with L2L^2, there is always a leverage beyond which more exposure means less wealth. The optimum depends on μ\mu — the number you know least well — so professionals size below it. Overestimate your edge and optimal leverage becomes ruinous leverage. This is the seed of the Kelly criterion (Session 3.6 — Bet Sizing, Kelly & Ruin) and of volatility targeting (Session 9.5 — Sizing, Vol Targeting & Allocating Across Strategies).

2.3.7 Return bugs that fake alpha

None of these raise an exception. All of them change your conclusions. Every one has shipped in a real backtest.

BugSymptomFix
Summing simple returns over timeLab: sum = 209%, true total = 442%(1 + r).prod() - 1, or sum log returns
Weighting log returns across assetsLab: +30%/−20% at 50/50 gives 0.0196 instead of 0.0488Weight simple returns, then take the log
√252 on weekly or monthly dataSharpe inflated by √21 ≈ 4.6× on monthly dataAnnualise with periods per year of that data
Returns on unadjusted pricesFake crashes on splits; dividends missingUse adjusted or total-return series
Forgetting the risk-free rateCash-like strategies look skilful when rates are highAlways compute on excess returns
Percent vs percentage points"Returns fell 2%" when they fell from 10% to 8%Say "2 percentage points"
⚠️ Pitfall — "3× leveraged ETF = 3× the index return"

Only for one day. A daily-rebalanced 3× fund held for a year earns roughly 3μ−2rf−92σ23\mu - 2r_f - \tfrac{9}{2}\sigma^2 in log terms (it borrows two dollars for every dollar of capital; fees and financing above the risk-free rate make it worse), not 3μ3\mu. If the index ends a volatile year flat, the 3× fund ends it down. This is the arithmetic of §2.3.6 — and why leveraged ETFs are trading tools, not investments.

2.3.8 Try it

Open the companion lab and break things on purpose.

🔧 Try it (15 min, in the lab)

1. Before running anything, compute L⋆L^\star by hand for μ=8%\mu = 8\%, rf=3%r_f = 3\% and σ=30%\sigma = 30\%. Then change SIGMA in the lab and check your answer against the leverage table.
2. Replace lab.rng with np.random.default_rng(1) and rerun section 2. How much do the arithmetic mean and the Sharpe ratio move? That spread is estimation error.
3. Success looks like this: your hand-computed L⋆L^\star matches the peak of the new column chart to within one step.


2.3.9 Glossary · Check yourself · Go deeper

P&L — profit and loss in currency; what you earned, scaled by position size.
Simple return — Rt=(Pt+Dt)/Pt−1−1R_t = (P_t + D_t)/P_{t-1} - 1; adds exactly across assets.
Log return — rt=ln⁡(1+Rt)r_t = \ln(1 + R_t); adds exactly across time.
Excess return — return minus the risk-free rate over the same period; the part that measures skill.
Compounding — returns multiplying on a growing (or shrinking) base: ∏(1+Rt)\prod (1 + R_t).
Annualisation — rescaling to a yearly figure: mean × periods, volatility × √periods.
Volatility — the standard deviation of returns, usually annualised.
Volatility drag — the gap between arithmetic mean and compound growth, ≈ σ²/2 a year.
Sharpe ratio — annualised mean excess return divided by its annualised volatility.
Drawdown — the fall of wealth below its running peak; the maximum drawdown is the worst one.
Leverage — exposure per unit of capital; multiplies excess return and volatility, and drag by its square.

Check yourself

1. A fund reports an average annual return of 12% but a CAGR of 8%. Roughly how volatile is it?
Drag ≈ 12% − 8% = 4% ≈ σ²/2, so σ ≈ √0.08 ≈ 28% a year. A large gap between the arithmetic and geometric returns is a volatility tell.
2. You hold three assets with weights 50/30/20 and have their daily log returns. How do you get the portfolio's daily return?
Convert each to simple returns (R=er−1R = e^r - 1), take the weighted sum, and convert back if you need a log return. Weighting log returns directly is only approximately right — and badly wrong on big moves.
3. A strategy's monthly returns have a Sharpe ratio of 0.30. What is the annualised figure — and what are you assuming?
0.30 × √12 ≈ 1.04. Not × √252: annualise with the number of periods per year of the data you have. The √12 assumes monthly returns are independent; positive autocorrelation makes the true figure lower.
4. The S&P 500 ends a very choppy year exactly flat. What happened to a daily-rebalanced 3× fund on it?
It lost money. A flat index means μ≈σ2/2\mu \approx \sigma^2/2. The 3× fund's log growth is about 3μ−2rf−92σ2=−3σ2−2rf3\mu - 2r_f - \tfrac{9}{2}\sigma^2 = -3\sigma^2 - 2r_f: its drag grows with the square of the leverage, and it pays to borrow. Leverage turns volatility into a certain cost.
5. A colleague's backtest reports a total return of 209% by summing daily returns. Is that too high or too low?
It could be either — summing simple returns ignores compounding. In the lab's 20-year path the true total was 442% against a naive sum of 209%. On a path with big drawdowns the sum can overstate instead. Always compound.
🔧 Homework (~1 h before Session 2.4)

1. Write annualise(returns, periods_per_year) that returns CAGR, volatility and Sharpe ratio, and unit-test it on data where you know the answer (a constant 0.1% daily return; a ±1% alternating series).
2. In the lab, add a "0.5× + cash" line to the growth chart. How much growth do you give up relative to 1×, and how much drawdown do you avoid?
3. Read Meucci's three-page note on linear vs compounded returns (below). Then find one chart in the financial press that averages returns it should have compounded.

📚 Go deeper

  1. Campbell, J. Y., Lo, A. W. & MacKinlay, A. C. (1997). The Econometrics of Financial Markets, ch. 1 "Introduction" (returns and their properties). Princeton University Press. ISBN 978-0-691-04301-2
  2. Meucci, A. (2010). "Quant Nugget 2: Linear vs. Compounded Returns — Common Pitfalls in Portfolio Management." GARP Risk Professional, April 2010, 49–51. SSRN 1586656
  3. Lo, A. W. (2002). "The Statistics of Sharpe Ratios." Financial Analysts Journal 58(4), 36–52. doi:10.2469/faj.v58.n4.2453
  4. Cheng, M. & Madhavan, A. (2009). "The Dynamics of Leveraged and Inverse Exchange-Traded Funds." Journal of Investment Management 7(4), 43–62. SSRN 1539120