From 338c1c54248e09767c5dc0550fa74b97fb5637f4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 5 Dec 2025 07:10:04 +0100 Subject: [PATCH] fix: compare timeout with <= instead of < closes #12590 Backtesting assumes round dates, so a timeout at "candle length" needs to timeout at the hour - not after the hour. otherwise the timeout becomes either double (60 instead of 30) - or longer by one "timeframe detail" (31 instead of 30). --- freqtrade/strategy/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 7ac196dba..34857c71e 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -1718,7 +1718,7 @@ class IStrategy(ABC, HyperStrategyMixin): timeout_unit = self.config.get("unfilledtimeout", {}).get("unit", "minutes") timeout_kwargs = {timeout_unit: -timeout} timeout_threshold = current_time + timedelta(**timeout_kwargs) - timedout = order.status == "open" and order.order_date_utc < timeout_threshold + timedout = order.status == "open" and order.order_date_utc <= timeout_threshold if timedout: return True time_method = (