trigger字段永久同步(strategy_lifecycle)+ 知微TODO系统
T006: regenerate_all() 新增 trigger 填充(stop_loss/entry_zone/take_profit_zone),
price_monitor 依赖此字段检测止损区间/买入区/止盈区触发。
历史数据已通过 fix_trigger.py 一次性补全39只。
新增 devops/self-todo skill + cronjob 自我驱动-TODO自动执行。
每天8轮检查pending任务,主动完成并报告进度。
TODO数据:~/.hermes/profiles/position-analyst/todo.json
This commit is contained in:
@@ -1553,6 +1553,25 @@ def regenerate_all(stdout=True):
|
||||
**extra,
|
||||
}
|
||||
stock["analysis"] = analysis
|
||||
# 同步 top-level 字段 → zone_breach/price_monitor 依赖这些字段
|
||||
# (2026-06-24 bugfix: analysis 子对象有但顶层没有,导致新持仓的止损检测盲区)
|
||||
stock["stop_loss"] = result.get("stop_loss", 0)
|
||||
stock["take_profit"] = result.get("take_profit", 0)
|
||||
stock["entry_low"] = result.get("entry_low", 0)
|
||||
stock["entry_high"] = result.get("entry_high", 0)
|
||||
# 同步 trigger 字段 -> price_monitor 依赖
|
||||
sl = result.get("stop_loss", 0)
|
||||
tp = result.get("take_profit", 0)
|
||||
el = result.get("entry_low", 0)
|
||||
eh = result.get("entry_high", 0)
|
||||
trig = {}
|
||||
if sl and float(sl) > 0:
|
||||
trig["stop_loss"] = float(sl)
|
||||
if el and eh and float(el) > 0 and float(eh) > 0:
|
||||
trig["entry_zone"] = f"{float(el)}~{float(eh)}"
|
||||
if tp and float(tp) > 0:
|
||||
trig["take_profit_zone"] = f"0~{float(tp)}"
|
||||
stock["trigger"] = trig
|
||||
results.append({
|
||||
"code": code, "name": name,
|
||||
"price": price, "cost": cost,
|
||||
|
||||
Reference in New Issue
Block a user