feat(market_scanner): 增加趋势信号强度为零时的提示信息

在市场扫描逻辑中添加了对所有标的趋势信号强度为零的情况的日志记录,避免用户误解为异常。此改动旨在提升用户对市场状态的理解,并指导用户在特定情况下的交易决策。增强了系统的可用性与用户友好性。
This commit is contained in:
薇薇安 2026-02-25 11:10:13 +08:00
parent 104cb63802
commit 9c620e0aa0

View File

@ -327,6 +327,15 @@ class MarketScanner:
for i, symbol_info in enumerate(others, 1): for i, symbol_info in enumerate(others, 1):
self._log_single_symbol(i, symbol_info) self._log_single_symbol(i, symbol_info)
# 当所有标的趋势信号强度均为 0 时打一行说明,避免误以为异常
strong_count = sum(1 for s in top_n if s.get('signal_strength', 0) > 0)
if top_n and strong_count == 0:
logger.info(
"本轮扫描: 所有 %d 个标的趋势信号强度均为 0可能原因1h 与 4H 方向冲突被清零、或无明确 MACD 金叉/死叉、或多空冲突)。"
"仅当趋势信号≥5 才会生成合约推荐与自动交易。",
len(top_n),
)
return top_n return top_n
def _log_single_symbol(self, index: int, symbol_info: Dict): def _log_single_symbol(self, index: int, symbol_info: Dict):