Skip to content

Commit 985c15b

Browse files
committed
checking kraken data for any rows not having a timestamp in the timestamp column, purging those
(there was a text in the 1st row of USDGEUR.csv, making the conversion fail previously)
1 parent f2569e3 commit 985c15b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

freqtrade/data/converter/trade_converter_kraken.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def import_kraken_trades_from_csv(config: Config, convert_to: str):
6969
trades = pd.concat(dfs, ignore_index=True)
7070
del dfs
7171

72+
# drop any row not having a number in the column timestamp
73+
timestamp_numeric = pd.to_numeric(trades["timestamp"], errors="coerce")
74+
trades = trades[timestamp_numeric.notna() & (timestamp_numeric % 1 == 0)]
75+
7276
trades.loc[:, "timestamp"] = trades["timestamp"] * 1e3
7377
trades.loc[:, "cost"] = trades["price"] * trades["amount"]
7478
for col in DEFAULT_TRADES_COLUMNS:

0 commit comments

Comments
 (0)