From bfde33c945f4374fc8ca69075d41a2d9c731d6e9 Mon Sep 17 00:00:00 2001 From: xmatthias Date: Tue, 12 Jun 2018 21:12:55 +0200 Subject: [PATCH] Use timestamp() instead of strftime this will avoid a bug shifting epoch time by 1 hour: https://stackoverflow.com/questions/11743019/convert-python-datetime-to-epoch-with-strftime --- 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 ffd6e2768..f7fade102 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -234,8 +234,8 @@ class Backtesting(object): # record a tuple of pair, current_profit_percent, # entry-date, duration records.append((pair, trade_entry.profit_percent, - trade_entry.open_time.strftime('%s'), - trade_entry.close_time.strftime('%s'), + trade_entry.open_time.timestamp(), + trade_entry.close_time.timestamp(), index, trade_entry.trade_duration)) else: # Set lock_pair_until to end of testing period if trade could not be closed