From 17d748dd4c3156e353fb4cafea2ff7163accaa54 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 6 Feb 2022 13:19:00 +0100 Subject: [PATCH] Improve handling of left_open_trades --- freqtrade/optimize/backtesting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 4da8390af..737cede9d 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -609,7 +609,8 @@ class Backtesting: for pair in open_trades.keys(): if len(open_trades[pair]) > 0: for trade in open_trades[pair]: - if trade.open_order_id: + if trade.open_order_id and trade.nr_of_successful_buys == 0: + # Ignore trade if buy-order did not fill yet continue sell_row = data[pair][-1]