Skip to content

Commit ad25636

Browse files
committed
feat: dry-is-crossed should support stoploss
1 parent 73b4273 commit ad25636

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

freqtrade/exchange/exchange.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,13 +1254,14 @@ def _dry_is_price_crossed(
12541254
limit: float,
12551255
orderbook: OrderBook | None = None,
12561256
offset: float = 0.0,
1257+
is_stop: bool = False,
12571258
) -> bool:
12581259
if not self.exchange_has("fetchL2OrderBook"):
12591260
return True
12601261
if not orderbook:
12611262
orderbook = self.fetch_l2_order_book(pair, 1)
12621263
try:
1263-
if side == "buy":
1264+
if (side == "buy" and not is_stop) or (side == "sell" and is_stop):
12641265
price = orderbook["asks"][0][0]
12651266
if limit * (1 - offset) >= price:
12661267
return True

0 commit comments

Comments
 (0)