File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -35,19 +35,20 @@ def update_liquidation_prices(
3535
3636 open_trades : list [Trade ] = Trade .get_open_trades ()
3737 for t in open_trades :
38- # TODO: This should be done in a batch update
39- t .set_liquidation_price (
40- exchange .get_liquidation_price (
41- pair = t .pair ,
42- open_rate = t .open_rate ,
43- is_short = t .is_short ,
44- amount = t .amount ,
45- stake_amount = t .stake_amount ,
46- leverage = t .leverage ,
47- wallet_balance = total_wallet_stake ,
48- open_trades = open_trades ,
38+ if t .has_open_position :
39+ # TODO: This should be done in a batch update
40+ t .set_liquidation_price (
41+ exchange .get_liquidation_price (
42+ pair = t .pair ,
43+ open_rate = t .open_rate ,
44+ is_short = t .is_short ,
45+ amount = t .amount ,
46+ stake_amount = t .stake_amount ,
47+ leverage = t .leverage ,
48+ wallet_balance = total_wallet_stake ,
49+ open_trades = open_trades ,
50+ )
4951 )
50- )
5152 elif trade :
5253 trade .set_liquidation_price (
5354 exchange .get_liquidation_price (
You can’t perform that action at this time.
0 commit comments