diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index e8fcec875..814ab9cfb 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -84,7 +84,9 @@ def get_sell_trade_entry(pair, row, buy_subset, ticker, trade_count_lock, args): # Increase trade_count_lock for every iteration trade_count_lock[row2.date] = trade_count_lock.get(row2.date, 0) + 1 - buy_signal = buy_subset[buy_subset.date == row2.date].empty + # Buy is on is in the buy_subset there is a row that matches the date + # of the sell event + buy_signal = not buy_subset[buy_subset.date == row2.date].empty if(should_sell(trade, row2.close, row2.date, buy_signal, row2.sell)): return row2, (pair, trade.calc_profit_percent(rate=row2.close),