From 2d0aca0d20a8ebf31134939008053d093220dfe3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 4 Mar 2019 07:24:05 +0100 Subject: [PATCH] Move --customhyperopts to hyperopt section --- freqtrade/arguments.py | 16 ++++++++-------- freqtrade/configuration.py | 8 +++++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/freqtrade/arguments.py b/freqtrade/arguments.py index 62f22befc..ee19f6fe1 100644 --- a/freqtrade/arguments.py +++ b/freqtrade/arguments.py @@ -108,14 +108,6 @@ class Arguments(object): type=str, metavar='PATH', ) - self.parser.add_argument( - '--customhyperopt', - help='Specify hyperopt class name (default: %(default)s).', - dest='hyperopt', - default=constants.DEFAULT_HYPEROPT, - type=str, - metavar='NAME', - ) self.parser.add_argument( '--dynamic-whitelist', help='Dynamically generate and update whitelist' @@ -248,6 +240,14 @@ class Arguments(object): """ Parses given arguments for Hyperopt scripts. """ + parser.add_argument( + '--customhyperopt', + help='Specify hyperopt class name (default: %(default)s).', + dest='hyperopt', + default=constants.DEFAULT_HYPEROPT, + type=str, + metavar='NAME', + ) parser.add_argument( '--eps', '--enable-position-stacking', help='Allow buying the same pair multiple times (position stacking).', diff --git a/freqtrade/configuration.py b/freqtrade/configuration.py index bddf60028..e96305993 100644 --- a/freqtrade/configuration.py +++ b/freqtrade/configuration.py @@ -67,9 +67,6 @@ class Configuration(object): if self.args.strategy_path: config.update({'strategy_path': self.args.strategy_path}) - # Add the hyperopt file to use - config.update({'hyperopt': self.args.hyperopt}) - # Load Common configuration config = self._load_common_config(config) @@ -276,6 +273,11 @@ class Configuration(object): Extract information for sys.argv and load Hyperopt configuration :return: configuration as dictionary """ + + if "hyperopt" in self.args: + # Add the hyperopt file to use + config.update({'hyperopt': self.args.hyperopt}) + # If --epochs is used we add it to the configuration if 'epochs' in self.args and self.args.epochs: config.update({'epochs': self.args.epochs})