added isolated futures to supported modes for binance,gateio

This commit is contained in:
Sam Germain 2022-01-10 06:45:54 -06:00
parent e0df7ee72a
commit ba5fc21d84
4 changed files with 5 additions and 7 deletions

View File

@ -33,10 +33,9 @@ class Binance(Exchange):
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
# TradingMode.SPOT always supported and not required in this list
# TODO-lev: Uncomment once supported
# (TradingMode.MARGIN, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.ISOLATED)
(TradingMode.FUTURES, Collateral.ISOLATED)
]
def stoploss_adjust(self, stop_loss: float, order: Dict, side: str) -> bool:

View File

@ -27,6 +27,7 @@ class Ftx(Exchange):
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
# TradingMode.SPOT always supported and not required in this list
# TODO-lev: Uncomment once supported
# (TradingMode.MARGIN, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.CROSS)
]

View File

@ -31,7 +31,7 @@ class Gateio(Exchange):
# TradingMode.SPOT always supported and not required in this list
# (TradingMode.MARGIN, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.ISOLATED)
(TradingMode.FUTURES, Collateral.ISOLATED)
]
def validate_ordertypes(self, order_types: Dict) -> None:

View File

@ -3442,26 +3442,24 @@ def test_set_margin_mode(mocker, default_conf, collateral):
# TODO-lev: Remove once implemented
("binance", TradingMode.MARGIN, Collateral.CROSS, True),
("binance", TradingMode.FUTURES, Collateral.CROSS, True),
("binance", TradingMode.FUTURES, Collateral.ISOLATED, True),
("kraken", TradingMode.MARGIN, Collateral.CROSS, True),
("kraken", TradingMode.FUTURES, Collateral.CROSS, True),
("ftx", TradingMode.MARGIN, Collateral.CROSS, True),
("ftx", TradingMode.FUTURES, Collateral.CROSS, True),
("gateio", TradingMode.MARGIN, Collateral.CROSS, True),
("gateio", TradingMode.FUTURES, Collateral.CROSS, True),
("gateio", TradingMode.FUTURES, Collateral.ISOLATED, True),
# TODO-lev: Uncomment once implemented
# ("binance", TradingMode.MARGIN, Collateral.CROSS, False),
# ("binance", TradingMode.FUTURES, Collateral.CROSS, False),
# ("binance", TradingMode.FUTURES, Collateral.ISOLATED, False),
("binance", TradingMode.FUTURES, Collateral.ISOLATED, False),
# ("kraken", TradingMode.MARGIN, Collateral.CROSS, False),
# ("kraken", TradingMode.FUTURES, Collateral.CROSS, False),
# ("ftx", TradingMode.MARGIN, Collateral.CROSS, False),
# ("ftx", TradingMode.FUTURES, Collateral.CROSS, False),
# ("gateio", TradingMode.MARGIN, Collateral.CROSS, False),
# ("gateio", TradingMode.FUTURES, Collateral.CROSS, False),
# ("gateio", TradingMode.FUTURES, Collateral.ISOLATED, False),
("gateio", TradingMode.FUTURES, Collateral.ISOLATED, False),
])
def test_validate_trading_mode_and_collateral(
default_conf,