From 985c15bdd99599116bdb449f119ee79f0a37f46b Mon Sep 17 00:00:00 2001 From: hippocritical Date: Sun, 8 Jun 2025 14:07:31 +0200 Subject: [PATCH 1/2] 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) --- freqtrade/data/converter/trade_converter_kraken.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/freqtrade/data/converter/trade_converter_kraken.py b/freqtrade/data/converter/trade_converter_kraken.py index 911fcd17b..49b6463c9 100644 --- a/freqtrade/data/converter/trade_converter_kraken.py +++ b/freqtrade/data/converter/trade_converter_kraken.py @@ -69,6 +69,10 @@ def import_kraken_trades_from_csv(config: Config, convert_to: str): trades = pd.concat(dfs, ignore_index=True) del dfs + # drop any row not having a number in the column timestamp + timestamp_numeric = pd.to_numeric(trades["timestamp"], errors="coerce") + trades = trades[timestamp_numeric.notna() & (timestamp_numeric % 1 == 0)] + trades.loc[:, "timestamp"] = trades["timestamp"] * 1e3 trades.loc[:, "cost"] = trades["price"] * trades["amount"] for col in DEFAULT_TRADES_COLUMNS: From c997f020852ea763aaab4a1d8c7c1d8a6026942a Mon Sep 17 00:00:00 2001 From: hippocritical Date: Sun, 8 Jun 2025 19:31:17 +0200 Subject: [PATCH 2/2] removed %1 = 0 since it was not truly necessary --- freqtrade/data/converter/trade_converter_kraken.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/data/converter/trade_converter_kraken.py b/freqtrade/data/converter/trade_converter_kraken.py index 49b6463c9..1934ec4d4 100644 --- a/freqtrade/data/converter/trade_converter_kraken.py +++ b/freqtrade/data/converter/trade_converter_kraken.py @@ -71,7 +71,7 @@ def import_kraken_trades_from_csv(config: Config, convert_to: str): # drop any row not having a number in the column timestamp timestamp_numeric = pd.to_numeric(trades["timestamp"], errors="coerce") - trades = trades[timestamp_numeric.notna() & (timestamp_numeric % 1 == 0)] + trades = trades[timestamp_numeric.notna()] trades.loc[:, "timestamp"] = trades["timestamp"] * 1e3 trades.loc[:, "cost"] = trades["price"] * trades["amount"]