From 7713cfeb7996b478f20c65afab9a1b49318b062b Mon Sep 17 00:00:00 2001 From: Fredrik81 Date: Mon, 2 Mar 2020 21:02:32 +0100 Subject: [PATCH] Corrected logic for -j + and - argument --- freqtrade/optimize/hyperopt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 91507c347..c500e71bf 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -558,7 +558,8 @@ class Hyperopt: cpus = cpu_count() logger.info(f"Found {cpus} CPU cores. Let's make them scream!") config_jobs = self.config.get('hyperopt_jobs', -1) - if self.total_epochs < cpus and (config_jobs > self.total_epochs or config_jobs < 0): + if (config_jobs < 0 and (cpus + config_jobs + 1) > self.total_epochs) \ + or (config_jobs > 0 and config_jobs > self.total_epochs): config_jobs = self.total_epochs logger.info(f'Number of parallel jobs set as: {config_jobs}')