From 480c5117f1d41315eb9742bd64b028363b68be13 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Jun 2020 06:47:04 +0200 Subject: [PATCH] Handle empty return strings --- freqtrade/optimize/optimize_reports.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/optimize/optimize_reports.py b/freqtrade/optimize/optimize_reports.py index 4ec3dc3ad..9feb7f20d 100644 --- a/freqtrade/optimize/optimize_reports.py +++ b/freqtrade/optimize/optimize_reports.py @@ -373,21 +373,21 @@ def show_backtest_results(config: Dict, backtest_stats: Dict): table = text_table_sell_reason(sell_reason_stats=results['sell_reason_summary'], stake_currency=stake_currency) - if isinstance(table, str): + if isinstance(table, str) and len(table) > 0: print(' SELL REASON STATS '.center(len(table.splitlines()[0]), '=')) print(table) table = text_table_bt_results(results['left_open_trades'], stake_currency=stake_currency) - if isinstance(table, str): + if isinstance(table, str) and len(table) > 0: print(' LEFT OPEN TRADES REPORT '.center(len(table.splitlines()[0]), '=')) print(table) table = text_table_add_metrics(results) - if isinstance(table, str): + if isinstance(table, str) and len(table) > 0: print(' SUMMARY METRICS '.center(len(table.splitlines()[0]), '=')) print(table) - if isinstance(table, str): + if isinstance(table, str) and len(table) > 0: print('=' * len(table.splitlines()[0])) print()