Update optimize_reports

Update show_backtest_reults() to preserve backwards compatibility by fixing KeyError: 'results_per_buy_tag' for older hyperopt result files.
This commit is contained in:
raphael 2021-11-04 10:25:13 -04:00 committed by GitHub
parent eb280798d8
commit ae2343db93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'],