up
This commit is contained in:
parent
ec8447e116
commit
84344f7f60
@ -324,14 +324,9 @@ class FreqaiExampleStrategy(IStrategy):
|
||||
return dataframe
|
||||
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
# 改进买入信号条件
|
||||
# 使用 centralized 方法计算 MACD
|
||||
# 确保使用 centralized 方法计算 MACD
|
||||
dataframe = self.calculate_macd(dataframe)
|
||||
|
||||
# 再次检查 MACD 列是否存在
|
||||
if "macd" not in dataframe.columns or "macdsignal" not in dataframe.columns:
|
||||
logger.error("MACD 或 MACD 信号列仍然缺失,无法生成买入信号。")
|
||||
raise ValueError("dataframe 缺少必要的 MACD 列且无法重新计算。")
|
||||
|
||||
enter_long_conditions = [
|
||||
(dataframe["rsi"] < dataframe["buy_rsi_pred"]), # RSI 低于买入阈值
|
||||
(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user