From ffae0b2cd54eab2d6eea2eae026194ca9d3d9657 Mon Sep 17 00:00:00 2001 From: Samuel Husso Date: Tue, 9 Jan 2018 12:37:56 +0200 Subject: [PATCH] hyperopt: prettyfie best values when receiving SIGINT, use the global TRIALS --- freqtrade/optimize/hyperopt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 4162e0758..03f833c4a 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -121,7 +121,7 @@ def read_trials(trials_path=TRIALS_FILE): def log_trials_result(trials): - vals = trials.best_trial['misc']['vals'] + vals = json.dumps(trials.best_trial['misc']['vals'], indent=4) results = trials.best_trial['result']['result'] logger.info('Best result:\n%s\nwith values:\n%s', results, vals) @@ -289,7 +289,7 @@ def start(args): trials=TRIALS ) - results = sorted(trials.results, key=itemgetter('loss')) + results = sorted(TRIALS.results, key=itemgetter('loss')) best_result = results[0]['result'] except ValueError: