Fix some tests and rebase issues

This commit is contained in:
Matthias
2018-11-07 19:46:04 +01:00
parent 8044846d37
commit 7b62e71f23
5 changed files with 194 additions and 517 deletions

View File

@@ -105,7 +105,7 @@ class Hyperopt(Backtesting):
best_result['params']
)
if 'roi_t1' in best_result['params']:
logger.info('ROI table:\n%s', self.generate_roi_table(best_result['params']))
logger.info('ROI table:\n%s', self.custom_hyperopt.generate_roi_table(best_result['params']))
def log_results(self, results) -> None:
"""
@@ -147,19 +147,20 @@ class Hyperopt(Backtesting):
"""
spaces: List[Dimension] = []
if self.has_space('buy'):
spaces = {**spaces, **self.custom_hyperopt.indicator_space()}
spaces += self.custom_hyperopt.indicator_space()
if self.has_space('roi'):
spaces = {**spaces, **self.custom_hyperopt.roi_space()}
spaces += self.custom_hyperopt.roi_space()
if self.has_space('stoploss'):
spaces = {**spaces, **self.custom_hyperopt.stoploss_space()}
spaces += self.custom_hyperopt.stoploss_space()
return spaces
def generate_optimizer(self, params: Dict) -> Dict:
def generate_optimizer(self, _params: Dict) -> Dict:
params = self.get_args(_params)
if self.has_space('roi'):
self.analyze.strategy.minimal_roi = self.custom_hyperopt.generate_roi_table(params)
self.strategy.minimal_roi = self.custom_hyperopt.generate_roi_table(params)
if self.has_space('buy'):
self.populate_buy_trend = self.custom_hyperopt.buy_strategy_generator(params)
self.advise_buy = self.custom_hyperopt.buy_strategy_generator(params)
if self.has_space('stoploss'):
self.strategy.stoploss = params['stoploss']