fix: 代码级约束 —— 推荐前必须同步重评, 不输出无操作信号的信息

1. price_monitor: 区间突破后同步调reassess_with_context(), 明确信号推XMPP
2. stale_detector: 只输出有[PUSH]/[STRATEGY_STALE]标记的行, 静默无操作信号的买入区
3. mofin_collect: stale/无策略持仓同步重评, 不靠TODO异步
This commit is contained in:
知微
2026-07-07 10:31:50 +08:00
parent 2138ae2bfd
commit 26e2794cca
2 changed files with 61 additions and 7 deletions
+7 -6
View File
@@ -183,11 +183,9 @@ def main():
flags.append("[WL_IN]")
if strategy_deficient:
flags.append("[STRATEGY_STALE]")
prefix = "⚠️仓位挤占 " if position_pct > 80 else ""
issues.append(f"[STRATEGY_STALE] {prefix}{price:.2f}在买入区{el}~{eh}但策略不完整({'RR='+f'{rr:.2f}<1.5' if rr_invalid else '无止盈位' if not tp else '非买入信号'}),买入区需重评")
issues.append(f"[STRATEGY_STALE] 价{price:.2f}在买入区{el}~{eh}但策略不完整({'RR='+f'{rr:.2f}<1.5' if rr_invalid else '无止盈位' if not tp else '非买入信号'}),买入区需重评")
else:
prefix = "⚠️仓位挤占 " if position_pct > 80 else ""
issues.append(f"[PUSH] {prefix}{price:.2f}入买入区{el}~{eh}")
issues.append(f"[PUSH] 价{price:.2f}入买入区{el}~{eh}")
elif price > eh * 1.35:
flags.append("[WL_HIGH]")
issues.append(f"{price:.2f}高出买入区+{((price/eh)-1)*100:.0f}%,买入区需重评")
@@ -255,8 +253,11 @@ def main():
pass
if issues:
print(f"{' '.join(flags)} {tag} {name}({code}) 价{price:.2f}{chg} | 买入{el}~{eh} | {'; '.join(issues)}")
found += 1
# 仅输出有明确操作信号的行:[PUSH]=推荐买入, [STRATEGY_STALE]=需重评
# 静默其他纯信息行(如仅"价XX高出/高于买入区"而无操作建议)
if any("[PUSH]" in i or "[STRATEGY_STALE]" in i for i in issues):
print(f"{' '.join(flags)} {tag} {name}({code}) 价{price:.2f}{chg} | 买入{el}~{eh} | {'; '.join(issues)}")
found += 1
if found == 0:
print("[SILENT] 所有策略正常")