mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 03:41:14 +00:00
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).
This commit is contained in:
@@ -1718,7 +1718,7 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
timeout_unit = self.config.get("unfilledtimeout", {}).get("unit", "minutes")
|
timeout_unit = self.config.get("unfilledtimeout", {}).get("unit", "minutes")
|
||||||
timeout_kwargs = {timeout_unit: -timeout}
|
timeout_kwargs = {timeout_unit: -timeout}
|
||||||
timeout_threshold = current_time + timedelta(**timeout_kwargs)
|
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:
|
if timedout:
|
||||||
return True
|
return True
|
||||||
time_method = (
|
time_method = (
|
||||||
|
|||||||
Reference in New Issue
Block a user