From 8c19953cdd3c1aab5143d0ef8e5c6d2a442cf382 Mon Sep 17 00:00:00 2001 From: eSeR1805 Date: Sun, 1 May 2022 12:08:19 +0300 Subject: [PATCH] Quick exit when order should be maintained. --- freqtrade/optimize/backtesting.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 4485d3da3..e42bfd2ea 100755 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -890,7 +890,10 @@ class Backtesting: ) # default value is current order price # cancel existing order whenever a new rate is requested (or None) - if requested_rate != order.price: + if requested_rate == order.price: + # assumption: there can't be multiple open entry orders at any given time + return False + else: del trade.orders[trade.orders.index(order)] # place new order if None was not returned