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
This commit is contained in:
xmatthias 2018-06-12 21:12:55 +02:00
parent 12e455cbf5
commit bfde33c945

View File

@ -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