fix: floor timestamp to seconds

no candle has more than second precision.
This commit is contained in:
Matthias
2025-12-06 13:42:16 +01:00
parent 2845568f61
commit 3f0be5e41f

View File

@@ -38,7 +38,7 @@ def ohlcv_to_dataframe(
cols = DEFAULT_DATAFRAME_COLUMNS
df = DataFrame(ohlcv, columns=cols)
df["date"] = to_datetime(df["date"], unit="ms", utc=True)
df["date"] = to_datetime(df["date"], unit="ms", utc=True).dt.floor("s")
# Some exchanges return int values for Volume and even for OHLC.
# Convert them since TA-LIB indicators used in the strategy assume floats