From ae2343db93c0b5266f3d0960b62ef3009150759e Mon Sep 17 00:00:00 2001 From: raphael Date: Thu, 4 Nov 2021 10:25:13 -0400 Subject: [PATCH] Update optimize_reports Update show_backtest_reults() to preserve backwards compatibility by fixing KeyError: 'results_per_buy_tag' for older hyperopt result files. --- freqtrade/optimize/optimize_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/optimize_reports.py b/freqtrade/optimize/optimize_reports.py index a3a1aa5ce..14d928e54 100644 --- a/freqtrade/optimize/optimize_reports.py +++ b/freqtrade/optimize/optimize_reports.py @@ -797,7 +797,7 @@ def show_backtest_result(strategy: str, results: Dict[str, Any], stake_currency: print(' BACKTESTING REPORT '.center(len(table.splitlines()[0]), '=')) print(table) - if(results['results_per_buy_tag'] is not None): + if results.get('results_per_buy_tag') is not None: table = text_table_tags( "buy_tag", results['results_per_buy_tag'],