Disable dataprovider from hyperopt.

Dataprovider uses weak links to initialize, which cannot be pickled, and
therefore cannot be used during hyperopt.
This commit is contained in:
Matthias 2019-03-25 19:49:58 +01:00
parent 4cf7282027
commit e085fd9e95
2 changed files with 5 additions and 3 deletions

View File

@ -290,7 +290,7 @@ if self.dp:
so please be aware of it and make sure to not "look into the future" to avoid surprises when running in dry/live mode).
!!! Warning Warning in hyperopt
This option should only be used in `populate_indicators()` - since it pulls the historic data from disk each time, which would be a huge performance penalty during hyperopt.
This option cannot currently be used during hyperopt.
#### Available Pairs

View File

@ -69,8 +69,10 @@ class Backtesting(object):
exchange_name = self.config.get('exchange', {}).get('name', 'bittrex').title()
self.exchange = ExchangeResolver(exchange_name, self.config).exchange
self.fee = self.exchange.get_fee()
self.dataprovider = DataProvider(self.config, self.exchange)
IStrategy.dp = self.dataprovider
if self.config.get('runmode') != RunMode.HYPEROPT:
self.dataprovider = DataProvider(self.config, self.exchange)
IStrategy.dp = self.dataprovider
if self.config.get('strategy_list', None):
# Force one interval