streetyoga / atapi

Backtest, forward test and apply trading algorithms and strategies on binance spot, futures and nft market and other exchanges, including arbitrage.
MIT License
5 stars 5 forks source link

Implement Sortino Ratio #41

Open miron opened 2 years ago

miron commented 2 years ago
def sortino_ratio(df, threshold=0, rfr):
    """Annual Sortino Ratio
    downside = df[df < treshold]
    std = downside.std()
    _sortino_ratio = (self.mean_returns() - rfr) / std
    return sortino_ratio * np.sqrt(TD)