chore: improve arguments to get_liquidation_price

This commit is contained in:
Matthias
2024-08-30 17:59:22 +02:00
parent 5358f2fb9e
commit 45e75f3d09
4 changed files with 2 additions and 9 deletions

View File

@@ -3532,7 +3532,7 @@ class Exchange:
stake_amount: float,
leverage: float,
wallet_balance: float,
other_trades: list,
other_trades: Optional[list] = None,
) -> Optional[float]:
"""
Set's the margin mode on the exchange to cross or isolated for a specific pair
@@ -3554,7 +3554,7 @@ class Exchange:
leverage=leverage,
stake_amount=stake_amount,
wallet_balance=wallet_balance,
other_trades=other_trades,
other_trades=other_trades or [],
)
else:
positions = self.fetch_positions(pair)

View File

@@ -56,7 +56,6 @@ def update_liquidation_prices(
stake_amount=trade.stake_amount,
leverage=trade.leverage,
wallet_balance=trade.stake_amount,
other_trades=[],
)
)
else:

View File

@@ -294,8 +294,6 @@ def test_liquidation_price_binance(
stake_amount=open_rate * amount,
leverage=5,
other_trades=other_contracts,
# mm_ex_1=mm_ex_1,
# upnl_ex_1=upnl_ex_1,
),
2,
)

View File

@@ -5524,7 +5524,6 @@ def test_liquidation_price_is_none(
stake_amount=open_rate * 71200.81144,
leverage=5,
wallet_balance=-56354.57,
other_trades=[],
)
is None
)
@@ -5970,7 +5969,6 @@ def test_get_liquidation_price1(mocker, default_conf):
stake_amount=18.884 * 0.8,
leverage=leverage,
wallet_balance=18.884 * 0.8,
other_trades=[],
)
assert liq_price == 17.47
@@ -5984,7 +5982,6 @@ def test_get_liquidation_price1(mocker, default_conf):
stake_amount=18.884 * 0.8,
leverage=leverage,
wallet_balance=18.884 * 0.8,
other_trades=[],
)
assert liq_price == 17.540699999999998
@@ -5998,7 +5995,6 @@ def test_get_liquidation_price1(mocker, default_conf):
stake_amount=18.884 * 0.8,
leverage=leverage,
wallet_balance=18.884 * 0.8,
other_trades=[],
)
assert liq_price is None
default_conf["trading_mode"] = "margin"