Quantitative finance in ten ideas

quant finance

On this page
  1. 1. Hedge funds and the fee that shapes them
  2. 2. Returns compound
  3. 3. Risk, and three ratios that divide by it
  4. 4. Diversification: correlation decides what cancels
  5. 5. Portfolio optimisation takes its inputs literally
  6. 6. Execution: a trade pays the spread, the book and the impact
  7. 7. Valuation: price is observed, value is estimated
  8. 8. Beta is a slope, alpha is what is left
  9. 9. Prices are hard to beat
  10. 10. Data lies in known ways
  11. 11. A strategy is a chain, judged net at the end
  12. The formula sheet
  13. The arithmetic to be fluent in

This is the map of the series. Each idea gets one paragraph, its key number from the blog’s five tickers (SPY, AAPL, JPM, XOM, GLD, daily adjusted closes 2019 to 2023), and a link to the post that works it through with formulas, worked numbers and code. The ideas are in the order each one needs the one before it. At the end is the formula sheet for the whole series.

Two habits do most of the work:

Multiply, never add, returns. Scale volatility and Sharpe by the square root of time, never by time. And for every number in a backtest, ask when it was known.

1. Hedge funds and the fee that shapes them

A hedge fund is a lightly regulated pool paid mostly on performance, “2 and 20”: 2% of assets every year, then 20% of the return, both on absolute return, not on return above a benchmark. On a 10% year the manager takes 3.6 points, over a third of the return; in a losing year the 2% is still charged. The investor is buying lower volatility, not higher return. Full post: What is quantitative finance?.

2. Returns compound

Returns multiply. Chain periods by multiplying growth factors, because each period starts from the last one’s end: +10% then −10% leaves 0.99, a loss. A −50% drawdown needs +100% to recover. Annualise a return with a power, volatility and Sharpe with the square root of time (√252 ≈ 15.87 for daily, √12 ≈ 3.46 for monthly). Full post: Returns compound: multiply, never add.

3. Risk, and three ratios that divide by it

Return without risk is half a number. Sharpe divides excess return by total volatility, Sortino by downside volatility only, the information ratio by tracking error against a benchmark. Each answers a different question, and all three scale with √time. Drawdown is the risk the ratios miss: how far from the peak, and for how long. Full post: Sharpe, Sortino and information ratio.

4. Diversification: correlation decides what cancels

Portfolio risk depends on how holdings move together, not how many you hold. Correlation changes the risk and never the expected return, which stays the weighted average. With correlation ρ between every pair, adding assets drives risk down to a floor of ρσ², never to zero; in the 2020 crash the five tickers’ correlations jumped, and the floor rose exactly when it mattered. Full post: Covariance and correlation.

5. Portfolio optimisation takes its inputs literally

Mean-variance optimisation picks weights from estimated returns and covariances. The maths is exact, the inputs are noisy, so the optimiser piles into whatever looked best in the window it saw. Over five rolling windows the optimised portfolio beat equal weights in some and lost in others; constraints (long only, weight caps) are what make the answer holdable. Full post: Portfolio optimisation.

6. Execution: a trade pays the spread, the book and the impact

An idea becomes profit only after paying the bid-ask spread, walking the order book, moving the price, and, for shorts, borrowing. A market order guarantees execution and risks the price; a limit order guarantees the price and risks never filling. A buyer trades at the ask. At 0.5% per trade a rule that trades almost daily turned +14.5% gross into −95%. Full post: What a trade really costs.

7. Valuation: price is observed, value is estimated

A dollar later is worth less than a dollar now, because a dollar now can earn rr. Present value divides by (1+r)n(1 + r)^n; the Gordon model prices a growing dividend stream as D1/(r−g)D_1 / (r - g) and blows up as gg approaches rr. Small changes in rr or gg move the value a lot, which is why value is an estimate and the margin of safety exists. Full post: Value is an estimate.

8. Beta is a slope, alpha is what is left

Plot a stock’s daily return against the market’s and fit a line. Beta is the slope, how much of the market’s move you carry (AAPL: 1.24 against SPY); alpha is the intercept, what is left after paying for that exposure. CAPM turns beta into a required return, and a hedge sized in beta-dollars removes the market from a position. Full post: Beta and alpha.

9. Prices are hard to beat

Efficiency is about what information prices already contain: weak form (past prices), semi-strong (public news), strong (even insiders). SPY’s day-to-day autocorrelation is −0.17, enough to make a “buy after a down day” rule look great before costs and lose nearly everything after them. A roulette doubling rule shows the same shape: most runs win small, the rare run loses everything, and the expected value is still negative. Full post: Why prices are hard to beat.

10. Data lies in known ways

Most “alpha” in a backtest is a data bug: survivorship (the losers were deleted), look-ahead (a number used before it was known), multiple testing (1,000 coin-flip signals produce about 50 “significant” ones), unadjusted prices (a split looks like a crash). Know each bug and its fix. Full post: Data that lies.

11. A strategy is a chain, judged net at the end

Hypothesis, data, signal, sizing, execution, costs, evaluation. Every link can silently break the chain, so judge the net result at the end against a benchmark, not the signal at the start. Full post: Backtesting in Python.

The formula sheet

TopicFormulaRemember
Cumulative return∏(1+r)−1\prod (1 + r) - 1multiply
CAGR(Vend/Vstart)1/T−1(V_{\text{end}}/V_{\text{start}})^{1/T} - 1root, not divide
Annualise return(1+r)n−1(1 + r)^n - 1nn = 12 or 252
Annualise σ, Sharpe×n\times \sqrt{n}√252 ≈ 15.87, √12 ≈ 3.46
Recovery1/(1−L)−11/(1 - L) - 1−50% needs +100%
Sharpe(R−Rf)/σ(R - R_f)/\sigmatotal risk
Sortino(R−T)/σdown(R - T)/\sigma_{\text{down}}bad risk only
Information ratio(R−Rb)/tracking error(R - R_b)/\text{tracking error}against a benchmark
Covarianceρ σAσB\rho\,\sigma_A\sigma_Bcarries units
Two-asset variancewA2σA2+wB2σB2+2wAwBρσAσBw_A^2\sigma_A^2 + w_B^2\sigma_B^2 + 2w_Aw_B\rho\sigma_A\sigma_Bρ only in the cross term
Perfect hedgewA/wB=σB/σAw_A/w_B = \sigma_B/\sigma_Ainverse to volatility
Turnover12∑∣Δw∣\tfrac{1}{2}\sum \lvert \Delta w \rverthalf
BetaCov(ri,rm)/Var(rm)=ρ σi/σm\text{Cov}(r_i, r_m)/\text{Var}(r_m) = \rho\,\sigma_i/\sigma_ma slope
CAPMRf+β(Rm−Rf)R_f + \beta(R_m - R_f)required return
Alphaactual − CAPMskill, if real
Hedge sizedollars × β_asset / β_hedgebeta-dollars
Present valueFV/(1+r)nFV/(1 + r)^ndivide
GordonD1/(r−g)D_1/(r - g)needs r>gr > g
Margin of safety(V−P)/V(V - P)/Vdivide by value
Spread, midask − bid; (ask + bid)/2buyer pays the ask
Impact costprice × (1 ± impact)plus commission per order
False positivestests × α1,000 × 5% = 50
Total return(P1+D−P0)/P0(P_1 + D - P_0)/P_0include the dividend
Gross leverage(long + short)/equitynet 0 is not safe
2 and 202% + 20% × (return − 2%)absolute return
Roulette doubling rulebust after kk losses in a row, P=0.5135kP = 0.5135^kthe median wins, the mean loses

The arithmetic to be fluent in

  1. Multiply growth factors; CAGR with a root; geometric mean.
  2. Daily to annual: σ × 15.87, Sharpe × 15.87; monthly × 3.46.
  3. Recovery gain after a loss; drawdown from the peak.
  4. Two-asset variance with the cross term, then the square root.
  5. Beta, CAPM, alpha, hedge size, beta-neutral weights.
  6. Present value, Gordon, margin of safety.
  7. Walk the book, slippage, short profit net of dividend and fee, impact plus commission.
  8. The roulette expected value: p×win−(1−p)×lossp \times \text{win} - (1 - p) \times \text{loss}, and a run of kk losses as 0.5135k0.5135^k.