From 81c8e8677dfa98f18661259389972bd844c111ef Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Jun 2020 06:56:59 +0200 Subject: [PATCH] use 0 as profit mean, not nan --- freqtrade/optimize/optimize_reports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/optimize_reports.py b/freqtrade/optimize/optimize_reports.py index 9feb7f20d..b334917ba 100644 --- a/freqtrade/optimize/optimize_reports.py +++ b/freqtrade/optimize/optimize_reports.py @@ -69,8 +69,8 @@ def _generate_result_line(result: DataFrame, max_open_trades: int, first_column: return { 'key': first_column, 'trades': len(result), - 'profit_mean': result['profit_percent'].mean(), - 'profit_mean_pct': result['profit_percent'].mean() * 100.0, + 'profit_mean': result['profit_percent'].mean() if len(result) > 0 else 0.0, + 'profit_mean_pct': result['profit_percent'].mean() * 100.0 if len(result) > 0 else 0.0, 'profit_sum': result['profit_percent'].sum(), 'profit_sum_pct': result['profit_percent'].sum() * 100.0, 'profit_total_abs': result['profit_abs'].sum(),