Lesson 8 of 15
Sharpe & Sortino Ratios
Sharpe & Sortino Ratios
Risk-adjusted return metrics let you compare strategies that have different risk profiles.
Sharpe Ratio — excess return per unit of total risk (annualized):
where is the mean daily return, is the daily risk-free rate, and is the sample std of daily returns.
Sortino Ratio — penalizes only downside volatility:
where is the sample std computed only over returns below (the "downside deviation").
The Sortino ratio is preferred when return distributions are asymmetric, because upside volatility is not a risk — it's a reward.
Your Task
Implement:
sharpe_ratio(returns, rf=0.0)— annualized Sharpe ratiosortino_ratio(returns, rf=0.0)— annualized Sortino ratio using downside std
Python runtime loading...
Loading...
Click "Run" to execute your code.