Sharpe ratio explained: risk-adjusted return for trading bots
Return alone is a vanity metric. A bot that makes 40% a year by riding a knife-edge of volatility is worse than one that makes 20% smoothly — and the Sharpe ratio is the number that proves it. The Sharpe ratio measures return per unit of risk, rewarding strategies that earn their gains calmly and penalising those that whipsaw to get there. It is the standard yardstick for comparing strategies fairly, and the headline statistic on every serious backtest. This guide explains the formula, what a good Sharpe actually is, why it favours smooth equity curves, and its blind spots — including when to reach for Sortino or Calmar instead.
What the Sharpe ratio is
The Sharpe ratio measures how much return a strategy earns for each unit of risk it takes, where risk is the volatility (standard deviation) of its returns. A higher Sharpe means the strategy is producing its gains more efficiently — smoother, with less stomach-churning along the way. It lets you compare a calm bot and a wild one on a level field instead of being seduced by the wild one’s headline return.
The formula
Sharpe = (return − risk-free rate) / standard deviation of returns, then scaled to an annual figure. The subtraction of the risk-free rate ensures you only get credit for the return above what a Treasury bill pays for zero risk.
python · sharpe.pyimport numpy as np
def sharpe(returns, rf=0.0, periods=252):
excess = np.array(returns) - rf/periods
return np.sqrt(periods) * excess.mean() / excess.std()
# periods=252 for daily bars, 52 weekly, 12 monthly
What is a good Sharpe ratio
| Sharpe (annual) | Reading |
|---|---|
| < 1 | Sub-par — return doesn’t justify the risk |
| 1 – 2 | Good — a solid, tradeable strategy |
| 2 – 3 | Very good — institutional-grade |
| > 3 | Exceptional — or overfit; be suspicious |
A backtest Sharpe above 3 should trigger scepticism, not celebration — it usually signals overfitting rather than a genuine edge, and it will collapse in forward testing.
Why smoothness wins
Because Sharpe divides by volatility, a strategy that reaches the same return with smaller, steadier swings scores higher. That smoothness is not just aesthetic: a smooth curve has shallower drawdowns, survives leverage better, and is psychologically possible to keep trading through a rough patch.
Blind spots
Sharpe treats upside volatility as “risk” just like downside, so it penalises a strategy for big winning days. It also assumes returns are normally distributed, which trading returns are not — fat tails and crash risk are invisible to it. A bot selling options can show a beautiful Sharpe right up until the tail event that ruins it. Never read Sharpe without also reading max drawdown.
Sortino and Calmar
Two refinements fix Sharpe’s blind spots. The Sortino ratio divides only by downside volatility, so it stops penalising upside swings. The Calmar ratio divides annual return by maximum drawdown, tying reward directly to the worst loss you had to endure. Read all three together with max drawdown on the backtester rather than trusting any single number.
Frequently asked questions
What is the Sharpe ratio?
The Sharpe ratio measures the return a strategy earns for each unit of risk it takes, where risk is the volatility of its returns. It is calculated as the return above the risk-free rate divided by the standard deviation of returns, then annualised. A higher Sharpe means gains are earned more efficiently and with a smoother equity curve.
What is a good Sharpe ratio for a trading bot?
A Sharpe below 1 is generally sub-par, 1 to 2 is good and tradeable, 2 to 3 is very good and institutional-grade, and above 3 is exceptional. However, a backtest Sharpe above 3 should raise suspicion of overfitting rather than excitement, because such results usually collapse in live forward testing.
Why does the Sharpe ratio favour smooth returns?
Because it divides return by volatility, a strategy that reaches the same return with smaller, steadier swings scores higher than one that whipsaws to get there. That smoothness is valuable beyond aesthetics — it means shallower drawdowns, better behaviour under leverage, and a curve a trader can psychologically keep trading through a rough patch.
What are the limitations of the Sharpe ratio?
Sharpe treats upside volatility as risk just like downside, penalising big winning days, and it assumes returns are normally distributed, which hides the fat-tail and crash risk that real trading returns carry. A strategy can show a great Sharpe right until a tail event ruins it, so it should always be read alongside maximum drawdown and metrics like Sortino and Calmar.