Convert trade open / close to timestamp

(to allow uniform analysis of backtest and real trade data - while
giving control of date-formatting to the endsystem.
This commit is contained in:
Matthias 2020-07-27 07:20:40 +02:00
parent 977a6d4e9c
commit aab5596fa6
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@ from typing import Any, Dict, List
from arrow import Arrow
from pandas import DataFrame
from numpy import int64
from tabulate import tabulate
from freqtrade.constants import DATETIME_PRINT_FORMAT, LAST_BT_RESULT_FN
@ -246,6 +247,9 @@ def generate_backtest_stats(config: Dict, btdata: Dict[str, DataFrame],
skip_nan=True)
daily_stats = generate_daily_stats(results)
results['open_timestamp'] = results['open_date'].astype(int64) // 1e6
results['close_timestamp'] = results['close_date'].astype(int64) // 1e6
backtest_days = (max_date - min_date).days
strat_stats = {
'trades': results.to_dict(orient='records'),