sharpe_ratio¶
-
sharpe_ratio
(prices_, risk_free_rate)[source]¶ Calculate Sharpe ratio
- Parameters
prices – series of prices for an asset
risk_free_rate (
Union
[Currency
,float
]) – a fixed rate or currency like USD
- Return type
Series
- Returns
Sharpe ratio
Usage
Given a price series and risk-free rate (a number, currency, or cash asset), returns the rolling Sharpe ratio.
For a fixed rate R, excess returns E are calculated as:
\(E_t = E_{t-1} + P_t - P_{t-1} * (1 + R * DCF_{t-1,t})\)
Subscripts refers to dates in the price series.
P is a point in the price series.
DCF is the day count fraction using the Act/360 convention.