Skip to content

Commit cd7b267

Browse files
committed
feat: record dry-run stop_price price separately
1 parent 1770a68 commit cd7b267

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

freqtrade/exchange/exchange.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ def create_dry_run_order(
11191119
leverage: float,
11201120
params: dict | None = None,
11211121
stop_loss: bool = False,
1122+
stop_price: float | None = None,
11221123
) -> CcxtOrder:
11231124
now = dt_now()
11241125
order_id = f"dry_run_{side}_{pair}_{now.timestamp()}"
@@ -1145,7 +1146,7 @@ def create_dry_run_order(
11451146
}
11461147
if stop_loss:
11471148
dry_order["info"] = {"stopPrice": dry_order["price"]}
1148-
dry_order[self._ft_has["stop_price_prop"]] = dry_order["price"]
1149+
dry_order[self._ft_has["stop_price_prop"]] = stop_price or dry_order["price"]
11491150
# Workaround to avoid filling stoploss orders immediately
11501151
dry_order["ft_order_type"] = "stoploss"
11511152
orderbook: OrderBook | None = None
@@ -1517,8 +1518,9 @@ def create_stoploss(
15171518
ordertype,
15181519
side,
15191520
amount,
1520-
stop_price_norm,
1521+
limit_rate or stop_price_norm,
15211522
stop_loss=True,
1523+
stop_price=stop_price_norm,
15221524
leverage=leverage,
15231525
)
15241526
return dry_order

0 commit comments

Comments
 (0)