From a48840509b4d168e44750e96bf6277dbbe53bb5d Mon Sep 17 00:00:00 2001 From: Samuel Husso Date: Sat, 6 Jan 2018 15:34:21 +0200 Subject: [PATCH] Hyperopt: use results from previous runs --- freqtrade/optimize/hyperopt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index febaa196d..c520ed81d 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -119,6 +119,7 @@ def read_trials(trials_path=TRIALS_FILE): # os.remove(trials_path) return trials + def log_results(results): """ log results if it is better than any previous evaluation """ global CURRENT_BEST_LOSS @@ -270,7 +271,11 @@ def start(args): # read trials file if we have one if os.path.exists(TRIALS_FILE): TRIALS = read_trials() - _CURRENT_TRIES = len([result for result in TRIALS.results if result['status'] == 'ok']) + _CURRENT_TRIES = len(TRIALS.results) + TOTAL_TRIES = TOTAL_TRIES + _CURRENT_TRIES + logger.info( + 'Continuing with trials. Current: {}, Total: {}' + .format(_CURRENT_TRIES, TOTAL_TRIES)) try: best_parameters = fmin(