Skip to content

Commit 338c1c5

Browse files
committed
fix: compare timeout with <= instead of <
closes freqtrade#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).
1 parent 68e5424 commit 338c1c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

freqtrade/strategy/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ def ft_check_timed_out(self, trade: Trade, order: Order, current_time: datetime)
17181718
timeout_unit = self.config.get("unfilledtimeout", {}).get("unit", "minutes")
17191719
timeout_kwargs = {timeout_unit: -timeout}
17201720
timeout_threshold = current_time + timedelta(**timeout_kwargs)
1721-
timedout = order.status == "open" and order.order_date_utc < timeout_threshold
1721+
timedout = order.status == "open" and order.order_date_utc <= timeout_threshold
17221722
if timedout:
17231723
return True
17241724
time_method = (

0 commit comments

Comments
 (0)