From b6b37160a73d55bfd09cb9dbce5d12298c7a8bc5 Mon Sep 17 00:00:00 2001 From: Marko Djordjevic Date: Sun, 15 Feb 2026 21:52:45 +0100 Subject: [PATCH] fix(ml): cast OHLCV arrays to float64 for TA-Lib compatibility --- services/ml/features/talib_features.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/ml/features/talib_features.py b/services/ml/features/talib_features.py index 16b5cc4..312779a 100644 --- a/services/ml/features/talib_features.py +++ b/services/ml/features/talib_features.py @@ -56,12 +56,12 @@ def compute_talib_indicators( # Make a copy to avoid modifying the original result_df = df.copy() - # Extract OHLCV arrays (TA-Lib expects numpy arrays) - open_prices = df['open'].values - high_prices = df['high'].values - low_prices = df['low'].values - close_prices = df['close'].values - volume = df['volume'].values + # Extract OHLCV arrays (TA-Lib expects float64/double numpy arrays) + open_prices = df['open'].values.astype(np.float64) + high_prices = df['high'].values.astype(np.float64) + low_prices = df['low'].values.astype(np.float64) + close_prices = df['close'].values.astype(np.float64) + volume = df['volume'].values.astype(np.float64) logger.info(f"Computing {len(indicators)} TA-Lib indicators")