If max_open_trade=-1 means it should be ignored.

This commit is contained in:
misagh
2018-11-14 11:37:53 +01:00
parent 5c8544a425
commit 51dfd2bf47
4 changed files with 23 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ class Configuration(object):
Class to read and init the bot configuration
Reuse this class for the bot, backtesting, hyperopt and every script that required configuration
"""
def __init__(self, args: Namespace) -> None:
self.args = args
self.config: Optional[Dict[str, Any]] = None
@@ -130,6 +131,10 @@ class Configuration(object):
if config.get('forcebuy_enable', False):
logger.warning('`forcebuy` RPC message enabled.')
# Setting max_open_trades to infinite if -1
if config.get('max_open_trades') == -1:
config['max_open_trades'] = float('inf')
logger.info(f'Using DB: "{config["db_url"]}"')
# Check if the exchange set by the user is supported