backtesting: only respect max_open_trades with realistic_simulation

This commit is contained in:
gcarq 2018-03-20 19:38:33 +01:00
parent 93931eb32b
commit a6a38735b1
1 changed files with 7 additions and 1 deletions

View File

@ -227,7 +227,13 @@ class Backtesting(object):
timerange=timerange
)
max_open_trades = self.config.get('max_open_trades', 0)
# Ignore max_open_trades in backtesting, except realistic flag was passed
if self.config.get('realistic_simulation', False):
max_open_trades = self.config['max_open_trades']
else:
self.logger.info('Ignoring max_open_trades (realistic_simulation not set) ...')
max_open_trades = 0
preprocessed = self.tickerdata_to_dataframe(data)
# Print timeframe