Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Annualizing a Sharpe vs. Sortino Ratio

Below are functions that (I hope) calculate Sharpe and Sortino ratios.
I have made their interfaces identical.
From here, "Commonly, Sharpe Ratios on a daily, weekly or monthly basis are annualized by multiplying by the square root of the higher frequency time period. This is because the effective return is proportional to time. Assuming a Weiner process governs stock prices, variance is proportional to time. Hence standard deviation is proportional to the square root of time. So you would scale a Sharpe Ratio by multiplying by t/√t = √t, where t is the frequency you are annualizing from."
So why doesn't this logic apply to a Sortino Ratio, i.e. why don't we have an equivalent np.sqrt(N) term in the last line?
Thanks

def annualised_Sharpe(daily_ret, yearly_benchmark_rate=0.05,N=252):
MAR = yearly_benchmark_rate/N
excess_daily_ret = daily_ret - MAR
return np.sqrt(N) * excess_daily_ret.mean() / excess_daily_ret.std()

def annualised_Sortino(daily_ret, yearly_benchmark_rate=0.05, N=252):
MAR = yearly_benchmark_rate/N
excess_daily_ret = daily_ret - MAR
target_downside_deviation = np.sqrt(np.mean(minimum(excess_daily_ret,0.0)**2))
sortino = excess_daily_ret.mean() / target_downside_deviation
# Add Period correction??
#return np.sqrt(N) * sortino
return sortino

2 responses

Thank you for posting those.
And with Bill's ok, this is an effort to calculate Beta, for both portfolio and individual securities. Ballpark. Needs improvement from others.

Hi Bill,
Your Sortino ratio calculation is correct. As for annualizing the Sortino, in my opinion, it shouldn't matter as long as you are consistent with whatever you do. The annualizing factor is just a scalar multiple of the calculation result, so it can't change the outcome of a ranking system using the Sortino as long as the same scalar is used in every case. Annualizing is common practice in industry, but algorithms don't care if you do it or not. I'm not 100% what the industry standard is for the Sortino, but a sqrt(252) multiple seems reasonable to me.