From c1b2e06edad52dc91602088c67c4a97b05780b16 Mon Sep 17 00:00:00 2001 From: xmatthias Date: Sun, 10 Jun 2018 09:07:04 +0200 Subject: [PATCH] simplify return from _get_sell_trade_entry --- freqtrade/optimize/backtesting.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index d6748bd76..acb419ef5 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -128,8 +128,7 @@ class Backtesting(object): trade.calc_profit_percent(rate=sell_row.close), trade.calc_profit(rate=sell_row.close), (sell_row.date - buy_row.date).seconds // 60 - ), \ - sell_row.date + ) if partial_ticker: # no sell condition found - trade stil open at end of backtest period sell_row = partial_ticker[-1] @@ -143,8 +142,7 @@ class Backtesting(object): trade.calc_profit_percent(rate=sell_row.close), trade.calc_profit(rate=sell_row.close), (sell_row.date - buy_row.date).seconds // 60 - ), \ - sell_row.date + ) return None def backtest(self, args: Dict) -> DataFrame: @@ -208,8 +206,8 @@ class Backtesting(object): trade_count_lock, args) if ret: - row2, trade_entry, next_date = ret - lock_pair_until = next_date + row2, trade_entry = ret + lock_pair_until = row2.date trades.append(trade_entry) if record: # Note, need to be json.dump friendly