question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sortino ratio of 4,000?

See original GitHub issue

This may just be a problem with data, but I am getting blown up sortino ratios. I thought they had to be much smaller.

For instance:

import yfinance as yf 

msft = yf.Ticker("ETH-USD")

def getSortino(h, p):
  sh = []
  for i in range(0, len(h)):
    if i > p:
      a = h['Close'].iloc[i-p:i]
      sh.append(ta.sortino_ratio(a))
    else: sh.append(0)

  return sh


h['rso364'] = getSortino(h, 364)
h['rso100'] = getSortino(h, 100)
h['rso1000'] = getSortino(h, 1000)

h.plot(y=['rso100', 'rso364', 'rso1000','Close'], linewidth=0.5)

Gives me a graph like this, I don’t believe max values should be in the range of 4,000. Perhaps there is some missing data or something, but not sure what could cause this…

PS: I keep finding this package extremely useful.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dorienhcommented, Apr 16, 2021

Oh just noticed the sign is not the issue as it’s preceded by:

downside = adjusted_benchmark_rate - returns

I’ll look into the definition that you implemented.

1reaction
dorienhcommented, Apr 14, 2021

Looks like we should all invest immediately lol.

The short timeframe may indeed reflect periods of near zero negative volatility. I’ll have a look at which time frame sortino is typically calculated, I’m actually not certain. I’ll have a look at the data as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sortino Ratio Calculator
The smart Sortino ratio calculator is an efficient tool that indicates the return of an investment considering its drawdown risk.
Read more >
How to calculate Sortino Ratio - Angel One
The Sortino ratio is calculated by dividing the difference between the return and risk-free return rates by the standard deviation of the negative...
Read more >
Sortino Ratio - DayTrading.com
The Sortino ratio is a means for traders and investors to gauge the risk-adjusted performance of their portfolios or strategies.
Read more >
Investment Portfolio Analysis: Sortino Ratio - Blake Mullen
The Sortino ratio measures the risk-adjusted return of an asset, portfolio, or strategy. Essentially, the ratio penalizes only those returns ...
Read more >
The Appraisal Ratio and Sortino Ratio - Bloomberg Prep
4000+ practice questions ... The Appraisal Ratio and Sortino Ratio ... The __Sortino ratio__ is once again return divided by risk, but both...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found