Merge pull request #9427 from froggleston/frog-bt-analysis-fix-1

Fix backtesting-analysis when no trades for a pair
This commit is contained in:
Matthias
2023-11-15 19:46:32 +01:00
committed by GitHub

View File

@@ -211,6 +211,7 @@ def prepare_results(analysed_trades, stratname,
timerange=None): timerange=None):
res_df = pd.DataFrame() res_df = pd.DataFrame()
for pair, trades in analysed_trades[stratname].items(): for pair, trades in analysed_trades[stratname].items():
if (trades.shape[0] > 0):
trades.dropna(subset=['close_date'], inplace=True) trades.dropna(subset=['close_date'], inplace=True)
res_df = pd.concat([res_df, trades], ignore_index=True) res_df = pd.concat([res_df, trades], ignore_index=True)