TODO一口气4/6完成
T001: enrich_timing_signal RR参数降级 T002: price_monitor已有XMPP推送(514-525行) T003: 自选扫描加15:00轮次 T005: 策略数据口径理解完成(非bug) T006: trigger同步(已完成) T004: 截图叙事清理待设计 system_health_check.py CRON_JOBS路径修正→正确的profile路径
This commit is contained in:
Binary file not shown.
+21
-2
@@ -1031,8 +1031,9 @@ def enrich_timing_signal(base_signal, macro_desc="", sector_note="",
|
|||||||
profit_pct=0, stock_category="", is_new_entry=False,
|
profit_pct=0, stock_category="", is_new_entry=False,
|
||||||
fundamentals=None, news_sentiment=None,
|
fundamentals=None, news_sentiment=None,
|
||||||
timing_signal_override=None,
|
timing_signal_override=None,
|
||||||
portfolio_context=None): # 新增参数
|
portfolio_context=None,
|
||||||
"""多因子合成timing_signal——大盘+行业+基本面+技术+组合风险
|
rr_ratio=0): # 2026-06-24 新参:盈亏比约束
|
||||||
|
"""多因子合成timing_signal——大盘+行业+基本面+技术+组合风险+盈亏比
|
||||||
|
|
||||||
返回 (enriched_signal, factors_list)
|
返回 (enriched_signal, factors_list)
|
||||||
- enriched_signal: 可读的多因子信号描述
|
- enriched_signal: 可读的多因子信号描述
|
||||||
@@ -1137,6 +1138,14 @@ def enrich_timing_signal(base_signal, macro_desc="", sector_note="",
|
|||||||
elif portfolio_context.get('is_high_weak'):
|
elif portfolio_context.get('is_high_weak'):
|
||||||
factors.append("组合风险信号")
|
factors.append("组合风险信号")
|
||||||
|
|
||||||
|
# 5.7 盈亏比因子(2026-06-24 新增——RR<1.5降级买入信号)
|
||||||
|
if rr_ratio > 0:
|
||||||
|
if rr_ratio < 1.5:
|
||||||
|
factors.append(f"RR{rr_ratio}过低")
|
||||||
|
elif rr_ratio >= 3:
|
||||||
|
factors.append(f"RR{rr_ratio}")
|
||||||
|
# 1.5~3之间:中性,不特别标注
|
||||||
|
|
||||||
# 如果没有足够因素,返回信号不充分
|
# 如果没有足够因素,返回信号不充分
|
||||||
if not factors:
|
if not factors:
|
||||||
return "信号不充分", []
|
return "信号不充分", []
|
||||||
@@ -1155,6 +1164,14 @@ def enrich_timing_signal(base_signal, macro_desc="", sector_note="",
|
|||||||
signal_found = f
|
signal_found = f
|
||||||
break
|
break
|
||||||
clean_signal = signal_found if signal_found else "信号不充分"
|
clean_signal = signal_found if signal_found else "信号不充分"
|
||||||
|
|
||||||
|
# 6. RR约束降级(2026-06-24 新增)
|
||||||
|
# 买入/加仓信号但RR<1.5 → 降级为"信号不充分"
|
||||||
|
buy_signals = {"买入", "加仓"}
|
||||||
|
if clean_signal in buy_signals and 0 < rr_ratio < 1.5:
|
||||||
|
clean_signal = "信号不充分"
|
||||||
|
factors.append("RR过低降级")
|
||||||
|
|
||||||
return clean_signal, factors
|
return clean_signal, factors
|
||||||
|
|
||||||
|
|
||||||
@@ -1196,6 +1213,7 @@ def reassess_with_context(code, name, price, cost, shares, current_action,
|
|||||||
fundamentals=fund,
|
fundamentals=fund,
|
||||||
news_sentiment=news_sentiment,
|
news_sentiment=news_sentiment,
|
||||||
portfolio_context=_get_portfolio_risk_state(),
|
portfolio_context=_get_portfolio_risk_state(),
|
||||||
|
rr_ratio=result.get("rr_ratio", 0),
|
||||||
)
|
)
|
||||||
result["timing_signal"] = enriched
|
result["timing_signal"] = enriched
|
||||||
result["signal_factors"] = factors
|
result["signal_factors"] = factors
|
||||||
@@ -1529,6 +1547,7 @@ def regenerate_all(stdout=True):
|
|||||||
is_new_entry=(source == "watchlist"),
|
is_new_entry=(source == "watchlist"),
|
||||||
fundamentals=fund,
|
fundamentals=fund,
|
||||||
news_sentiment=news_sentiment,
|
news_sentiment=news_sentiment,
|
||||||
|
rr_ratio=result.get("rr_ratio", 0),
|
||||||
)
|
)
|
||||||
result["timing_signal"] = enriched
|
result["timing_signal"] = enriched
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ PORTFOLIO_PATH = DATA_DIR / "portfolio.json"
|
|||||||
EVENTS_PATH = DATA_DIR / "price_events.json"
|
EVENTS_PATH = DATA_DIR / "price_events.json"
|
||||||
EVALUATION_PATH = DATA_DIR / "evaluation.json"
|
EVALUATION_PATH = DATA_DIR / "evaluation.json"
|
||||||
ACCURACY_PATH = DATA_DIR / "accuracy_stats.json"
|
ACCURACY_PATH = DATA_DIR / "accuracy_stats.json"
|
||||||
CRON_JOBS = "/home/hmo/.hermes/cron/jobs.json"
|
CRON_JOBS = "/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json"
|
||||||
POSITION_CRON = "/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json"
|
POSITION_CRON = "/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json"
|
||||||
|
|
||||||
def check(ok, msg):
|
def check(ok, msg):
|
||||||
|
|||||||
Reference in New Issue
Block a user