Skip to content

Commit c878c67

Browse files
committed
fix: improve datetime for trade_list_to_dataframe
closes freqtrade#12388
1 parent 642f24e commit c878c67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

freqtrade/data/btanalysis/bt_fileutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ def trade_list_to_dataframe(trades: list[Trade] | list[LocalTrade]) -> pd.DataFr
511511
"""
512512
df = pd.DataFrame.from_records([t.to_json(True) for t in trades], columns=BT_DATA_COLUMNS)
513513
if len(df) > 0:
514-
df["close_date"] = pd.to_datetime(df["close_date"], utc=True)
515-
df["open_date"] = pd.to_datetime(df["open_date"], utc=True)
514+
df["close_date"] = pd.to_datetime(df["close_timestamp"], unit="ms", utc=True)
515+
df["open_date"] = pd.to_datetime(df["open_timestamp"], unit="ms", utc=True)
516516
df["close_rate"] = df["close_rate"].astype("float64")
517517
return df
518518

0 commit comments

Comments
 (0)