-
-
Save quantra-go-algo/46b5d5869dc74cc05fc27670af04a0ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sharpe Ratio function | |
def sharpe(returns, daily_risk_free_rate, days=252): | |
volatility = returns.std() | |
sharpe_ratio = (returns.mean() - daily_risk_free_rate) / volatility * np.sqrt(days) | |
return sharpe_ratio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment