Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Risk adjusted returns based on Value at Risk
"""
Note that this Gist uses functions made available in another Gist -
https://gist.github.com/StuartGordonReid/67a1ec4fbc8a84c0e856
"""
def excess_var(er, returns, rf, alpha):
return (er - rf) / var(returns, alpha)
def conditional_sharpe_ratio(er, returns, rf, alpha):
return (er - rf) / cvar(returns, alpha)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment