Risk, return and the code behind them.

Returns and volatility, Sharpe and drawdowns, beta and regression, portfolio construction and VaR; factor investing and honest backtests; then Python and SQL to do the work yourself.

Quant foundationsSignals and strategiesProgramming for finance

Quant foundations

15 min read

Returns, volatility and annualisation

Simple and log returns, compounding, arithmetic versus geometric means, volatility drag, standard deviation and the square root of time rule, with its assumptions.

16 min read

Sharpe, Sortino and drawdowns

The Sharpe ratio, the Sortino ratio and downside deviation, information ratio and tracking error, maximum drawdown and Calmar, all worked on one twelve month series.

16 min read

Beta, correlation and regression

Covariance, correlation and beta by ordinary least squares, alpha and R squared, and the CAPM, with a full regression computed by hand on six months of returns.

18 min read

Portfolio construction and mean variance optimisation

Two asset portfolio variance, diversification, the efficient frontier, minimum variance and tangency weights, risk parity, and why estimation error dominates the answer.

17 min read

Value at Risk and expected shortfall

Parametric, historical and Monte Carlo VaR, scaling to longer horizons, expected shortfall, backtesting exceptions and what VaR cannot tell you.

Signals and strategies

17 min read

Factor investing: value, momentum, quality, size and low volatility

What a factor is, how long-short factor portfolios are built, the Fama French models, momentum's 12-1 construction, and how a regression splits a fund's return into factor exposure and alpha.

16 min read

Backtesting without fooling yourself

The biases that make backtests look better than live results, from look ahead and survivorship to costs and multiple testing, and the discipline that keeps a simulation honest.

Programming for finance

15 min read

Python for financial analysis

Setting up Python and pandas, then the everyday tasks: price tables, returns, rolling volatility, monthly resampling, joining two series and plotting.

14 min read

SQL for financial data

A schema for prices and holdings, then the queries analysts write every week: joins, GROUP BY, window functions for returns and running totals, ranking top holdings and point in time joins.

16 min read

Building a backtest in Python

A moving average crossover on one asset, end to end in pandas: signal, lagged position, returns, trading costs, equity curve, Sharpe ratio and maximum drawdown.