mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-03 02:23:05 +00:00
fix: Calculate liquidation price only once the initial order filled
closes #11318
This commit is contained in:
@@ -35,19 +35,20 @@ def update_liquidation_prices(
|
||||
|
||||
open_trades: list[Trade] = Trade.get_open_trades()
|
||||
for t in open_trades:
|
||||
# TODO: This should be done in a batch update
|
||||
t.set_liquidation_price(
|
||||
exchange.get_liquidation_price(
|
||||
pair=t.pair,
|
||||
open_rate=t.open_rate,
|
||||
is_short=t.is_short,
|
||||
amount=t.amount,
|
||||
stake_amount=t.stake_amount,
|
||||
leverage=t.leverage,
|
||||
wallet_balance=total_wallet_stake,
|
||||
open_trades=open_trades,
|
||||
if t.has_open_position:
|
||||
# TODO: This should be done in a batch update
|
||||
t.set_liquidation_price(
|
||||
exchange.get_liquidation_price(
|
||||
pair=t.pair,
|
||||
open_rate=t.open_rate,
|
||||
is_short=t.is_short,
|
||||
amount=t.amount,
|
||||
stake_amount=t.stake_amount,
|
||||
leverage=t.leverage,
|
||||
wallet_balance=total_wallet_stake,
|
||||
open_trades=open_trades,
|
||||
)
|
||||
)
|
||||
)
|
||||
elif trade:
|
||||
trade.set_liquidation_price(
|
||||
exchange.get_liquidation_price(
|
||||
|
||||
Reference in New Issue
Block a user