improve market_is_tradable tests

This commit is contained in:
Matthias
2021-11-01 09:24:00 +01:00
parent 534b0a5911
commit 0dd9a277d3
2 changed files with 5 additions and 11 deletions

View File

@@ -343,7 +343,9 @@ class Exchange:
Ensures that Configured mode aligns to
"""
return (
(self.trading_mode == TradingMode.SPOT and self.market_is_spot(market))
market.get('quote', None) is not None
and market.get('base', None) is not None
and (self.trading_mode == TradingMode.SPOT and self.market_is_spot(market))
or (self.trading_mode == TradingMode.MARGIN and self.market_is_margin(market))
or (self.trading_mode == TradingMode.FUTURES and self.market_is_future(market))
)