From 4b0a4c936a18ca900fc0b9b76f7030cda1f9fd88 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 5 Dec 2019 20:31:02 +0100 Subject: [PATCH 1/2] Fix hyperopt with ticker_interval from strategy --- 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 9c585ed72..a7b0e2bf6 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -54,10 +54,10 @@ class Hyperopt: def __init__(self, config: Dict[str, Any]) -> None: self.config = config - self.custom_hyperopt = HyperOptResolver(self.config).hyperopt - self.backtesting = Backtesting(self.config) + self.custom_hyperopt = HyperOptResolver(self.config).hyperopt + self.custom_hyperoptloss = HyperOptLossResolver(self.config).hyperoptloss self.calculate_loss = self.custom_hyperoptloss.hyperopt_loss_function From 703458f3656496c4cf8feee1bda08d69f3a89f66 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 5 Dec 2019 20:35:54 +0100 Subject: [PATCH 2/2] Add test for loading ticker-interval from strategy --- tests/optimize/test_hyperopt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index c9ae6ba1d..1f1706ee1 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -435,7 +435,8 @@ def test_start_calls_optimizer(mocker, default_conf, caplog, capsys) -> None: 'params': {'buy': {}, 'sell': {}, 'roi': {}, 'stoploss': 0.0}}]) ) patch_exchange(mocker) - + # Co-test loading ticker-interval from strategy + del default_conf['ticker_interval'] default_conf.update({'config': 'config.json.example', 'hyperopt': 'DefaultHyperOpt', 'epochs': 1,