From a071571eac51b6b91f849421ddf540a68cfb17e2 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Tue, 6 Feb 2018 12:13:12 +0200 Subject: [PATCH] switch to faster short circuiting condition --- freqtrade/optimize/backtesting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index ea03803fc..bfe8c33eb 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -86,7 +86,7 @@ def get_sell_trade_entry(pair, row, buy_subset, ticker, trade_count_lock, args): # 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.index == row2.Index].empty + buy_signal = (buy_subset.index == row2.Index).any() if(should_sell(trade, row2.close, row2.Index, buy_signal, row2.sell)): return row2, (pair, trade.calc_profit_percent(rate=row2.close),