Don't require non-mandatory arguments

This commit is contained in:
Matthias
2021-03-20 13:08:02 +01:00
parent fe7f3d9c37
commit 16a54b3616
2 changed files with 6 additions and 4 deletions

View File

@@ -100,12 +100,12 @@ def _validate_price_config(conf: Dict[str, Any]) -> None:
"""
When using market orders, price sides must be using the "other" side of the price
"""
if (conf['order_types'].get('buy') == 'market'
and conf['bid_strategy'].get('price_side') != 'ask'):
if (conf.get('order_types', {}).get('buy') == 'market'
and conf.get('bid_strategy', {}).get('price_side') != 'ask'):
raise OperationalException('Market buy orders require bid_strategy.price_side = "ask".')
if (conf['order_types'].get('sell') == 'market'
and conf['ask_strategy'].get('price_side') != 'bid'):
if (conf.get('order_types', {}).get('sell') == 'market'
and conf.get('ask_strategy', {}).get('price_side') != 'bid'):
raise OperationalException('Market sell orders require ask_strategy.price_side = "bid".')