Quant500 Academy

6. Performance and risk metrics that actually matter

Level 12: Backtesting and Real Risk Metrics

In trading, assessing a strategy's effectiveness and risk is crucial. Performance metrics help you judge profitability and consistency; risk metrics reveal potential vulnerabilities. Let us go through the main ones in each family.

Part 1: performance metrics

1. Return measures

2. Risk-adjusted measures

import numpy as np

excess = daily_returns - daily_risk_free_rate
annual_sharpe = np.sqrt(252) * excess.mean() / excess.std()
downside = excess[excess < 0]
annual_sortino = np.sqrt(252) * excess.mean() / downside.std()

3. Relative return measures

Part 2: risk metrics

1. Basic risk metrics

equity_curve = (1 + daily_returns).cumprod()
rolling_max = equity_curve.cummax()
drawdown = equity_curve / rolling_max - 1
max_drawdown = drawdown.min()

2. Relative risk measures

3. Tail risk measures

var_95 = np.percentile(daily_returns, 5)
cvar_95 = daily_returns[daily_returns <= var_95].mean()

Understanding and implementing these metrics lets you evaluate and refine strategies, balancing the pursuit of profitability with prudent risk management. Always consider the limitations and the applicability of each metric so that they fit your style and your objectives.

Why total return is not enough

Two strategies with the same 80% cumulative return can be entirely different universes if one achieved it with a 12% maximum drawdown and the other with a 55% one. And there is a piece of arithmetic worth burning into memory: recovering from a 40% fall requires a subsequent 66.7% rise; from a 50% fall, 100%. Losses and gains are not symmetric.

And a warning about the Sharpe: it punishes upside volatility just as much as downside volatility, and it implicitly assumes that standard deviation describes risk well. A strategy that systematically sells out-of-the-money options can display a very high Sharpe for years, with small and extremely regular returns, while accumulating an exposure that materializes in a single catastrophic session. The Sharpe does not see that tail; maximum drawdown and CVaR do.

To go deeper into this lesson

The rest of Quant500

What you are learning, applied to the index every day:

The model portfolio, weekly in your inbox

Every Saturday, its week in one minute: how it went, the best and the worst, and which insiders bought with their own money. Plus, the day the model is rebuilt, which stocks come in and which go out. A simulation, not advice. At most one email a week, no ads, no account; one-click unsubscribe. Made by one person: Pol Gracia.

A model portfolio with simulated results, not a personalized recommendation. Your email is used for this only: privacy.

Behind the Academy and the rest of Quant500 there is one person: Pol Gracia Serrahima.