Skip to content

Commit 278bd0e

Browse files
committed
chore: improve variable naming
1 parent d5b296c commit 278bd0e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

freqtrade/exchange/exchange.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,19 +1692,18 @@ def fetch_stoploss_order(
16921692
params = params or {}
16931693
params["stop"] = True
16941694
order = self.fetch_order(order_id, pair, params)
1695-
if (val := self.get_option("stoploss_algo_order_info_id")) and order.get(
1696-
"status", "open"
1697-
) == "closed":
1695+
val = self.get_option("stoploss_algo_order_info_id")
1696+
if val and order.get("status", "open") == "closed":
16981697
if new_orderid := order.get("info", {}).get(val):
16991698
# Fetch real order, which was placed by the algo order.
1700-
order1 = self.fetch_order(order_id=new_orderid, pair=pair, params=None)
1701-
order1["id_stop"] = order1["id"]
1702-
order1["id"] = order_id
1703-
order1["type"] = "stoploss"
1704-
order1["stopPrice"] = order.get("stopPrice")
1705-
order1["status_stop"] = "triggered"
1706-
1707-
return order1
1699+
actual_order = self.fetch_order(order_id=new_orderid, pair=pair, params=None)
1700+
actual_order["id_stop"] = actual_order["id"]
1701+
actual_order["id"] = order_id
1702+
actual_order["type"] = "stoploss"
1703+
actual_order["stopPrice"] = order.get("stopPrice")
1704+
actual_order["status_stop"] = "triggered"
1705+
1706+
return actual_order
17081707

17091708
return order
17101709

0 commit comments

Comments
 (0)