enable --dmmp for hyperopt

This commit is contained in:
hroff-1902 2019-07-14 20:56:17 +03:00
parent c474e2ac86
commit efbc7cccb1
1 changed files with 10 additions and 0 deletions

View File

@ -190,11 +190,21 @@ class Hyperopt(Backtesting):
self.strategy.stoploss = params['stoploss']
processed = load(TICKERDATA_PICKLE)
# Use max_open_trades for hyperopt as well, except --disable-max-market-positions is set
if self.config.get('use_max_market_positions', True):
max_open_trades = self.config['max_open_trades']
else:
logger.info('Ignoring max_open_trades (--disable-max-market-positions was used) ...')
max_open_trades = 0
min_date, max_date = get_timeframe(processed)
results = self.backtest(
{
'stake_amount': self.config['stake_amount'],
'processed': processed,
'max_open_trades': max_open_trades,
'position_stacking': self.config.get('position_stacking', False),
'start_date': min_date,
'end_date': max_date,