feat: 三维共振层落地(技术×资金×消息合成+signal_veto_log全程记录) + 综合评分列(收益30/胜率20/夏普20/盈亏比15/回撤15) + 普适性列(月份分布熵)

This commit is contained in:
hmo
2026-07-29 03:23:25 +08:00
parent 6ee7d348ce
commit c9e7079ee6
4 changed files with 212 additions and 2 deletions
@@ -1474,6 +1474,30 @@ def reassess_strategy(code, name, price, cost, shares, current_action,
except Exception as _e:
print(f" [v7.1闸门] 评估异常(放行): {_e}", flush=True)
# ----- 【三维共振层】技术×资金×消息合成判断(2026-07-29 老爸批准,全程记录) -----
_res_decision = None
if is_new_entry and any(s in timing_signal for s in ("买入", "加仓", "可追")):
try:
from resonance import evaluate_resonance, log_resonance
_res = evaluate_resonance(code, _gate if '_gate' in dir() and _gate else {'score': 0, 'summary': ''}, name)
_res_decision = _res["decision"]
_sig_before = timing_signal
if _res_decision == "veto":
timing_signal = "观望"
action_note = (action_note + " | 三维否决: " + _res["reason"]) if action_note else ("三维否决: " + _res["reason"])
elif _res_decision == "downgrade":
timing_signal = "关注"
action_note = (action_note + " | 三维降级: " + _res["reason"]) if action_note else ("三维降级: " + _res["reason"])
elif _res_decision == "resonance":
action_note = (action_note + " | " + _res["reason"]) if action_note else _res["reason"]
log_resonance(code, name, price,
_gate if '_gate' in dir() and _gate else {'score': 0, 'summary': ''},
_res, _sig_before, timing_signal)
if _res_decision != "pass":
print(f" [三维共振] {_sig_before}{timing_signal}: {_res['reason']}", flush=True)
except Exception as _e:
print(f" [三维共振] 评估异常(放行): {_e}", flush=True)
# ----- 构造 action 描述(供 cron prompt 使用) -----
action_parts = []
# 非持仓(自选股/未持有,shares=0):盈亏标签无意义——cost=0 → profit_pct=0 →