add order_filled callback call for stoploss orders

This commit is contained in:
Axel-CH 2024-03-21 19:36:58 -04:00
parent 996fcb6f56
commit 72225daa6a

View File

@ -1232,6 +1232,10 @@ class FreqtradeBot(LoggingMixin):
# We check if stoploss order is fulfilled
if stoploss_order and stoploss_order['status'] in ('closed', 'triggered'):
trade.exit_reason = ExitType.STOPLOSS_ON_EXCHANGE.value
strategy_safe_wrapper(
self.strategy.order_filled, default_retval=None)(
pair=trade.pair, trade=trade, order=slo,
current_time=datetime.now(timezone.utc))
self._notify_exit(trade, "stoploss", True)
self.handle_protections(trade.pair, trade.trade_direction)
return True