Skip to content

Commit

Permalink
Fix backtesting bug when canceling orders
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed May 31, 2022
1 parent 66edbcd commit 34a44b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions freqtrade/optimize/backtesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,11 +932,13 @@ def check_order_cancel(
else:
# Close additional entry order
del trade.orders[trade.orders.index(order)]
trade.open_order_id = None
return False
if order.side == trade.exit_side:
self.timedout_exit_orders += 1
# Close exit order and retry exiting on next signal.
del trade.orders[trade.orders.index(order)]
trade.open_order_id = None
return False
return None

Expand Down

0 comments on commit 34a44b9

Please sign in to comment.