Quick exit when order should be maintained.

This commit is contained in:
eSeR1805 2022-05-01 12:08:19 +03:00
parent 3be2afdd88
commit 8c19953cdd
No known key found for this signature in database
GPG Key ID: BA53686259B46936

View File

@ -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