Moved bittrex leverage test to exception thrown instead of None
This commit is contained in:
parent
4f5d74d74e
commit
a8f6c15358
@ -13,12 +13,7 @@ def liquidation_price(
|
|||||||
collateral: Optional[Collateral]
|
collateral: Optional[Collateral]
|
||||||
) -> Optional[float]:
|
) -> Optional[float]:
|
||||||
|
|
||||||
leverage_exchanges = [
|
if trading_mode == TradingMode.SPOT:
|
||||||
'binance',
|
|
||||||
'kraken',
|
|
||||||
'ftx'
|
|
||||||
]
|
|
||||||
if trading_mode == TradingMode.SPOT or exchange_name.lower() not in leverage_exchanges:
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if not collateral:
|
if not collateral:
|
||||||
@ -34,7 +29,7 @@ def liquidation_price(
|
|||||||
elif exchange_name.lower() == "ftx":
|
elif exchange_name.lower() == "ftx":
|
||||||
return ftx(open_rate, is_short, leverage, trading_mode, collateral)
|
return ftx(open_rate, is_short, leverage, trading_mode, collateral)
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
f"liquidation_price is not yet implemented for {exchange_name}"
|
f"liquidation_price is not implemented for {exchange_name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,10 +19,6 @@ isolated = Collateral.ISOLATED
|
|||||||
('bittrex', "2.0", False, "3.0", spot, None),
|
('bittrex', "2.0", False, "3.0", spot, None),
|
||||||
('bittrex', "2.0", False, "1.0", spot, cross),
|
('bittrex', "2.0", False, "1.0", spot, cross),
|
||||||
('bittrex', "2.0", True, "3.0", spot, isolated),
|
('bittrex', "2.0", True, "3.0", spot, isolated),
|
||||||
('bittrex', "2.0", False, "3.0", margin, cross),
|
|
||||||
('bittrex', "2.0", False, "3.0", margin, isolated),
|
|
||||||
('bittrex', "2.0", False, "3.0", futures, cross),
|
|
||||||
('bittrex', "2.0", False, "3.0", futures, isolated),
|
|
||||||
# Binance
|
# Binance
|
||||||
('binance', "2.0", False, "3.0", spot, None),
|
('binance', "2.0", False, "3.0", spot, None),
|
||||||
('binance', "2.0", False, "1.0", spot, cross),
|
('binance', "2.0", False, "1.0", spot, cross),
|
||||||
@ -55,6 +51,11 @@ def test_liquidation_price_is_none(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('exchange_name,open_rate,is_short,leverage,trading_mode,collateral', [
|
@pytest.mark.parametrize('exchange_name,open_rate,is_short,leverage,trading_mode,collateral', [
|
||||||
|
# Bittrex
|
||||||
|
('bittrex', "2.0", False, "3.0", margin, cross),
|
||||||
|
('bittrex', "2.0", False, "3.0", margin, isolated),
|
||||||
|
('bittrex', "2.0", False, "3.0", futures, cross),
|
||||||
|
('bittrex', "2.0", False, "3.0", futures, isolated),
|
||||||
# Binance
|
# Binance
|
||||||
# Binance supports isolated margin, but freqtrade likely won't for a while on Binance
|
# Binance supports isolated margin, but freqtrade likely won't for a while on Binance
|
||||||
('binance', "2.0", True, "3.0", margin, isolated),
|
('binance', "2.0", True, "3.0", margin, isolated),
|
||||||
|
Loading…
Reference in New Issue
Block a user