Merge branch 'freqtrade:develop' into bt-metrics

This commit is contained in:
Stefano Ariestasia
2023-01-06 08:04:00 +08:00
committed by GitHub
16 changed files with 106 additions and 162 deletions

View File

@@ -239,7 +239,7 @@ def calculate_sortino(trades: pd.DataFrame, min_date: datetime, max_date: dateti
down_stdev = np.std(trades.loc[trades['profit_abs'] < 0, 'profit_abs'] / starting_balance)
if down_stdev != 0:
if down_stdev != 0 and not np.isnan(down_stdev):
sortino_ratio = expected_returns_mean / down_stdev * np.sqrt(365)
else:
# Define high (negative) sortino ratio to be clear that this is NOT optimal.