fix(ml): cast OHLCV arrays to float64 for TA-Lib compatibility
This commit is contained in:
parent
f850728d44
commit
b6b37160a7
1 changed files with 6 additions and 6 deletions
|
|
@ -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")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue