okama.Portfolio.get_sharpe_ratio

Portfolio.get_sharpe_ratio(rf_return=0)

Calculate Sharpe ratio.

The Sharpe ratio is the average annual return in excess of the risk-free rate per unit of risk (annualized standard deviation).

Risk-free rate should be taken according to the Portfolio base currency.

Parameters:
rf_returnfloat, default 0

Risk-free rate of return.

Returns:
float

Examples

>>> pf = ok.Portfolio(['VOO.US', 'BND.US'], weights=[0.40, 0.60])
>>> pf.get_sharpe_ratio(rf_return=0.04)
0.7412193684695373