fix(ml): handle missing volume data and skip volume-dependent indicators
- Fill volume with 0 when column is absent from candle data - Skip MFI/OBV/AD/ADOSC indicators when no real volume data available - Fix pandas FutureWarning for inplace fillna in candle_features - Remove temporary debug NaN logging
This commit is contained in:
parent
b6b37160a7
commit
317f925c43
2 changed files with 18 additions and 3 deletions
|
|
@ -88,7 +88,7 @@ def compute_candle_features(df: pd.DataFrame) -> pd.DataFrame:
|
|||
# Gap (open - previous close)
|
||||
# For the first candle, gap is 0
|
||||
result_df['gap'] = result_df['open'] - result_df['close'].shift(1)
|
||||
result_df['gap'].fillna(0.0, inplace=True)
|
||||
result_df['gap'] = result_df['gap'].fillna(0.0)
|
||||
|
||||
logger.info("Computed 8 candle features: body_size, body_direction, upper_wick, "
|
||||
"lower_wick, wick_ratio, body_to_range, gap, range")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue