fix(ml): cast OHLCV arrays to float64 for TA-Lib compatibility

This commit is contained in:
Marko Djordjevic 2026-02-15 21:52:45 +01:00
parent f850728d44
commit b6b37160a7

View file

@ -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")