From ab39ac29e80c23d4e2128dedd7b193c88527d606 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 6 Dec 2024 20:05:33 +0100 Subject: [PATCH] fix: ensure data type is maintained when data comes from cache. --- freqtrade/data/converter/orderflow.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/freqtrade/data/converter/orderflow.py b/freqtrade/data/converter/orderflow.py index fc016664e..877325e5e 100644 --- a/freqtrade/data/converter/orderflow.py +++ b/freqtrade/data/converter/orderflow.py @@ -113,10 +113,11 @@ def populate_dataframe_with_trades( ): logger.info(f"Using cached orderflow data for {candle_start}") # Check if the trades are already in the cache + cache_idx = cached_grouped_trades.index[ + cached_grouped_trades["date"] == candle_start + ][0] for col in ADDED_COLUMNS: - dataframe.at[index, col] = cached_grouped_trades.loc[ - (cached_grouped_trades["date"] == candle_start), col - ].values + dataframe.at[index, col] = cached_grouped_trades.at[cache_idx, col] continue dataframe.at[index, "trades"] = trades_grouped_df.drop(