log增强
This commit is contained in:
parent
562b0a6f49
commit
1e31f22ee8
@ -460,14 +460,34 @@ class FreqaiPrimer(IStrategy):
|
||||
stochrsi_value = dataframe["stochrsi_k"].iloc[-1]
|
||||
bb_close_value = dataframe["close"].iloc[-1]
|
||||
bb_lower_value = dataframe["bb_lowerband"].iloc[-1]
|
||||
logger.info(f"[{pair}] 买入条件检查 - "
|
||||
f"&-price_value_divergence={divergence_value:.6f} < {self.buy_threshold:.6f}: {cond1.iloc[-1]}, "
|
||||
f"volume_z_score={volume_z_score_value:.2f} > {volume_z_score_threshold:.2f}: {cond2.iloc[-1]}, "
|
||||
f"rsi={rsi_value:.2f} < {rsi_threshold:.2f}: {cond3.iloc[-1]}, "
|
||||
f"close={bb_close_value:.6f} <= bb_lowerband={bb_lower_value:.6f}: {cond4.iloc[-1]}, "
|
||||
f"stochrsi_k={stochrsi_value:.2f} < {stochrsi_threshold:.2f}: {cond5.iloc[-1]}, "
|
||||
f"非熊市={cond6.iloc[-1]}, "
|
||||
f"STOCHRSI未持续超买={cond7.iloc[-1]}")
|
||||
# 定义条件名称和状态
|
||||
conditions_summary = [
|
||||
("&-price_value_divergence", divergence_value, "<", self.buy_threshold, cond1.iloc[-1]),
|
||||
("volume_z_score", volume_z_score_value, ">", volume_z_score_threshold, cond2.iloc[-1]),
|
||||
("rsi", rsi_value, "<", rsi_threshold, cond3.iloc[-1]),
|
||||
("close <= bb_lowerband", bb_close_value, "<=", bb_lower_value, cond4.iloc[-1]),
|
||||
("stochrsi_k", stochrsi_value, "<", stochrsi_threshold, cond5.iloc[-1]),
|
||||
("非熊市", None, None, None, cond6.iloc[-1]),
|
||||
("STOCHRSI未持续超买", None, None, None, cond7.iloc[-1]),
|
||||
]
|
||||
|
||||
# 输出每个条件的状态
|
||||
logger.info(f"[{pair}] === 买入条件检查 ===")
|
||||
failed_conditions = []
|
||||
for name, value, operator, threshold, result in conditions_summary:
|
||||
status = "✅" if result else "❌"
|
||||
if value is not None and threshold is not None:
|
||||
logger.info(f"[{pair}] {status} {name}: {value:.6f} {operator} {threshold:.6f}")
|
||||
else:
|
||||
logger.info(f"[{pair}] {status} {name}")
|
||||
if not result:
|
||||
failed_conditions.append(name)
|
||||
|
||||
# 总结未通过的条件
|
||||
if failed_conditions:
|
||||
logger.info(f"[{pair}] ❌ 买入条件未满足,原因:以下条件未通过: {', '.join(failed_conditions)}")
|
||||
else:
|
||||
logger.info(f"[{pair}] ✅ 所有买入条件均已满足")
|
||||
else:
|
||||
logger.warning(f"[{pair}] &-price_value_divergence 列缺失,跳过买入信号生成")
|
||||
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] === 买入条件检查 ===
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ❌ &-price_value_divergence: -0.017264 < -0.018560
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ❌ volume_z_score: -0.39 > 1.21
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ✅ rsi: 46.80 < 49.20
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ❌ close <= bb_lowerband: 3.765000 <= 3.755910
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ❌ stochrsi_k: 93.36 < 39.20
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ✅ 非熊市
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ✅ STOCHRSI未持续超买
|
||||
2025-07-30 13:27:24 INFO freqaiprimer - [DOT/USDT] ❌ 买入条件未满足,原因:以下条件未通过: &-price_value_divergence, volume_z_score, close <= bb_lowerband, stochrsi_k
|
||||
>>>>>>> Snippet
|
||||
Loading…
x
Reference in New Issue
Block a user