Created
June 12, 2015 13:54
-
-
Save StuartGordonReid/6c1b4281e6662cad397f to your computer and use it in GitHub Desktop.
Revisions
-
StuartGordonReid created this gist
Jun 12, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ """ Note that this Gist uses functions made available in another Gist - https://gist.github.com/StuartGordonReid/67a1ec4fbc8a84c0e856 """ def omega_ratio(er, returns, rf, target=0): return (er - rf) / lpm(returns, target, 1) def sortino_ratio(er, returns, rf, target=0): return (er - rf) / math.sqrt(lpm(returns, target, 2)) def kappa_three_ratio(er, returns, rf, target=0): return (er - rf) / math.pow(lpm(returns, target, 3), float(1/3)) def gain_loss_ratio(returns, target=0): return hpm(returns, target, 1) / lpm(returns, target, 1) def upside_potential_ratio(returns, target=0): return hpm(returns, target, 1) / math.sqrt(lpm(returns, target, 2))