Small reformatting in hyperopt

This commit is contained in:
Matthias 2021-05-02 11:01:26 +02:00
parent 8ee0b0d8e8
commit d069ad43d8
2 changed files with 4 additions and 3 deletions

View File

@ -243,7 +243,6 @@ class Hyperopt:
"""
backtest_start_time = datetime.now(timezone.utc)
params_dict = self._get_params_dict(self.dimensions, raw_params)
params_details = self._get_params_details(params_dict)
# Apply parameters
if HyperoptTools.has_space(self.config, 'roi'):
@ -287,12 +286,13 @@ class Hyperopt:
})
return self._get_results_dict(bt_results, self.min_date, self.max_date,
params_dict, params_details,
params_dict,
processed=processed)
def _get_results_dict(self, backtesting_results, min_date, max_date,
params_dict, params_details, processed: Dict[str, DataFrame]
params_dict, processed: Dict[str, DataFrame]
) -> Dict[str, Any]:
params_details = self._get_params_details(params_dict)
strat_stats = generate_strategy_stats(
processed, self.backtesting.strategy.get_strategy_name(),

View File

@ -688,6 +688,7 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
'trailing_stop_positive': 0.02,
'trailing_stop_positive_offset': 0.07}},
'params_dict': optimizer_param,
'params_not_optimized': {'buy': {}, 'sell': {}},
'results_metrics': ANY,
'total_profit': 3.1e-08
}