fix issue

This commit is contained in:
Ubuntu 2025-08-14 22:03:18 +08:00
parent 9de48b288c
commit eb4d6fd8a6

View File

@ -1095,7 +1095,12 @@ class FreqaiPrimer(IStrategy):
hist_df = dataframe.iloc[:i+1] if i != -1 else dataframe
if len(hist_df) > 0:
# 使用新的 get_trend_score_with_cache 方法替代直接调用 get_market_trend
timestamp = int(hist_df.index[-1].timestamp()) # 获取时间戳
# 确保索引是 datetime 类型
if not isinstance(hist_df.index, pd.DatetimeIndex):
hist_df.index = pd.to_datetime(hist_df.index)
# 获取时间戳
timestamp = int(hist_df.index[-1].timestamp())
score = self.get_trend_score_with_cache(pair=pair, timeframe=self.timeframe, timestamp=timestamp, dataframe=hist_df, metadata=metadata)
trend_scores_20.append(score)
else: