What is the Sharpe Ratio?
It answers one question: how much return are you getting for the risk you're taking? A Sharpe of 1.0 means you're earning 1% of excess return for every 1% of volatility. Above 1.0 is good. Above 2.0 is exceptional. Below 0 means you'd be better off in a risk-free savings account.
Sharpe = (Portfolio Return − Risk-Free Rate) / Portfolio Volatility
Optimisation goal: find weights w₁…wₙ that maximise this ratio
Subject to: Σwᵢ = 1, wᵢ ≥ 0 (no short selling)
What does the optimizer actually do?
It runs thousands of random weight combinations and finds the one that produces the highest Sharpe Ratio. The result is the Maximum Sharpe Portfolio — also called the Tangency Portfolio, because it sits at the point where a line from the risk-free rate is tangent to the efficient frontier. Every other portfolio on the frontier is either taking more risk than necessary or earning less return than possible.