From 08237abe20f650a093ab10dad983823ed63ef514 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 18 Jul 2018 09:06:12 +0200 Subject: [PATCH] Fix wrong backtest duration identified in #1038 --- freqtrade/optimize/backtesting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 05bcdf4b7..1ca2dacec 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -159,7 +159,7 @@ class Backtesting(object): profit_abs=trade.calc_profit(rate=sell_row.open), open_time=buy_row.date, close_time=sell_row.date, - trade_duration=(sell_row.date - buy_row.date).seconds // 60, + trade_duration=(sell_row.date - buy_row.date).total_seconds() // 60, open_index=buy_row.Index, close_index=sell_row.Index, open_at_end=False, @@ -174,7 +174,7 @@ class Backtesting(object): profit_abs=trade.calc_profit(rate=sell_row.open), open_time=buy_row.date, close_time=sell_row.date, - trade_duration=(sell_row.date - buy_row.date).seconds // 60, + trade_duration=(sell_row.date - buy_row.date)..total_seconds() // 60, open_index=buy_row.Index, close_index=sell_row.Index, open_at_end=True,