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:
parent
977a6d4e9c
commit
aab5596fa6
@ -5,6 +5,7 @@ from typing import Any, Dict, List
|
|||||||
|
|
||||||
from arrow import Arrow
|
from arrow import Arrow
|
||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
|
from numpy import int64
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
||||||
from freqtrade.constants import DATETIME_PRINT_FORMAT, LAST_BT_RESULT_FN
|
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)
|
skip_nan=True)
|
||||||
daily_stats = generate_daily_stats(results)
|
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
|
backtest_days = (max_date - min_date).days
|
||||||
strat_stats = {
|
strat_stats = {
|
||||||
'trades': results.to_dict(orient='records'),
|
'trades': results.to_dict(orient='records'),
|
||||||
|
Loading…
Reference in New Issue
Block a user