chore: 同步运行版本与git一致

- strategy_lifecycle.py: GATE_9D_ANALYSIS → GATE_12D_ANALYSIS(12维交叉验证)
- system_audit.py: 审计策略评估改用holding_strategies.updated_at
- CHANGELOG.md + analyst-knowledge-log.md 日常更新
This commit is contained in:
知微
2026-07-17 23:08:11 +08:00
parent b4a5020cf5
commit 90966c63ca
10 changed files with 12650 additions and 5684 deletions
+16
View File
@@ -273,3 +273,19 @@ Bot被bash包装器手动启动(非systemd),形成孤儿进程。systemd
4. **try/except 确保连接始终释放**rollback + close),修复原代码异常时 conn 泄漏
5. **三副本同步**profile/scripts + MoFin/scripts + MoFin/root
- **涉及文件**: scripts/price_monitor.py, /home/hmo/MoFin/scripts/price_monitor.py, /home/hmo/MoFin/price_monitor.py
## 2026-07-14 — intraday_health_check XMPP Bot误报修复
### 根因
check_bots() 使用 `systemctl is-active xmpp-zhiwei.service` 检查bot状态。但 xmpp-zhiwei.service 已于2026-07-14因与gateway管理冲突被主动停止(gateway watchdog管理bot生命周期),systemctl返回inactive→每次盘中自检报「知微XMPP Bot离线」。
同时:`ss -tnp` 非root用户看不到root进程(小果bot)的PID列,导致PID匹配失效。
### 修复
1. **check_bots() → check_bot_process()**: 彻底移除systemctl依赖
2. 改用双重检测:`/proc/{pid}/net/tcp`(检查ESTABLISHED+远端:5222+ 进程存在性(pid file/pgrep
3. 小果bot同理——读/proc/PID/net/tcp不受用户限制
4. 关闭历史误报TODOcancelled+解释说明)
### 涉及文件
- /home/hmo/.hermes/profiles/position-analyst/scripts/intraday_health_check.py
+78 -78
View File
@@ -1,6 +1,6 @@
{
"last_updated": "2026-07-09 12:09",
"total_candidates": 38,
"last_updated": "2026-07-17 15:38",
"total_candidates": 0,
"sectors_analyzed_today": [
"半导体",
"金属新材料",
@@ -467,8 +467,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -499,8 +499,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -531,8 +531,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -563,8 +563,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -595,8 +595,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -631,8 +631,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -663,8 +663,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -699,8 +699,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -731,8 +731,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -763,8 +763,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -795,8 +795,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -827,8 +827,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -867,8 +867,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -899,8 +899,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -939,8 +939,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -979,8 +979,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1019,8 +1019,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1055,8 +1055,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1087,8 +1087,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1119,8 +1119,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1151,8 +1151,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1183,8 +1183,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1215,8 +1215,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1247,8 +1247,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1279,8 +1279,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1311,8 +1311,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1343,8 +1343,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1387,8 +1387,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1431,8 +1431,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1463,8 +1463,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1495,8 +1495,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1527,8 +1527,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1559,8 +1559,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1591,8 +1591,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1623,8 +1623,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1655,8 +1655,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1687,8 +1687,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
},
@@ -1719,8 +1719,8 @@
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"dropped": true,
"drop_reason": "超7天未更新",
"trend_warning": false,
"trend_note": ""
}
+10899 -4519
View File
File diff suppressed because it is too large Load Diff
+1002 -420
View File
File diff suppressed because it is too large Load Diff
+301 -258
View File
@@ -1,19 +1,34 @@
{
"checked_at": "2026-07-09T09:00:42",
"total_active": 37,
"flagged_count": 24,
"checked_at": "2026-07-17T09:00:55",
"total_active": 58,
"flagged_count": 27,
"flagged": [
{
"code": "000657",
"name": "中钨高新",
"price": 73.95,
"code": "000518",
"name": "四环生物",
"price": 3.82,
"flags": [
"现价73.95在买入区72~75(是否可买需结合timing_signal判断)"
"现价3.82在买入区4~4(是否可买需结合timing_signal判断)"
],
"age_days": 2,
"last_update": "2026-07-14 09:29:52",
"entry_zone": "4~4",
"current": "盈利持有 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标4.04 | 止损3.71 | 买入区3.74~3.84 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "000711",
"name": "ST京蓝",
"price": 5.69,
"flags": [
"现价5.69在买入区6~6(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "72~75",
"current": "盈利持有 | 缩量 | 目标84.52 | 止损71.69 | 买入区72.47~75.43",
"last_update": "2026-07-16 09:17:37",
"entry_zone": "6~6",
"current": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标参考0 | 止损5.46 | 买入区5.58~5.8",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
@@ -21,60 +36,29 @@
{
"code": "000850",
"name": "华茂股份",
"price": 3.81,
"price": 3.95,
"flags": [
"现价3.81在买入区4~4(是否可买需结合timing_signal判断)"
"现价3.95在买入区4~4(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"last_update": "2026-07-16 09:24:03",
"entry_zone": "4~4",
"current": "盈利持有 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标4.04 | 止损3.7 | 买入区3.73~3.84",
"updated_by": "manual_analysis_v4",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "000949",
"name": "新乡化纤",
"price": 5.61,
"flags": [
"[STRATEGY_STALE] 信号不良(timing_signal含['弱势持有'])",
"现价5.61在买入区6~6(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-08 21:17:08",
"entry_zone": "6~6",
"current": "盈利持有 | 放量下跌⚠️ | 近5日增量跌价=⚠️出货型 | 目标5.99 | 止损5.44 | 买入区5.5~5.66 | 信号:弱势持有",
"updated_by": "auto",
"current": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 缩量 | 目标参考0 | 止损3.79 | 买入区3.87~4.03",
"updated_by": "manual_test",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "001309",
"name": "德明利",
"price": 825.0,
"price": 596.16,
"flags": [
"现价825.00在买入区808~842(是否可买需结合timing_signal判断)"
"现价596.16在买入区560~610(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "808~842",
"current": "盈利持有 | 正常 | 目标936.1 | 止损786.59 | 买入区808.5~841.5",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "002371",
"name": "北方华创",
"price": 802.32,
"flags": [
"现价802.32在买入区786~807(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "786~807",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.9),谨慎买入 | 正常 | 目标862.13 | 止损770.21 | 买入区786.27~806.98 | 信号:买入",
"last_update": "2026-07-16 21:11:09",
"entry_zone": "560~610",
"current": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 正常 | 目标625.97 | 止损596.16 | 买入区808.5~608.08",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
@@ -84,150 +68,12 @@
"name": "比亚迪",
"price": 87.8,
"flags": [
"现价87.80在买入区86~89(是否可买需结合timing_signal判断)"
"现价87.80在买入区86~88(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "86~89",
"current": "盈利持有 | 正常 | 目标94.19 | 止损85.17 | 买入区86.04~88.78 | 信号:买入",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "00700",
"name": "腾讯控股",
"price": 474.8,
"flags": [
"现价474.80在买入区465~484(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "465~484",
"current": "盈利持有 | 正常 | 目标519.27 | 止损460.56 | 买入区465.3~484.04",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "01088",
"name": "中国神华",
"price": 41.42,
"flags": [
"[STRATEGY_STALE] 信号不良(timing_signal含['弱势持有'])",
"现价41.42在买入区41~42(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "41~42",
"current": "盈利持有 | 正常 | 目标44.49 | 止损40.03 | 买入区40.59~41.81 | 信号:弱势持有",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "01211",
"name": "比亚迪股份",
"price": 85.5,
"flags": [
"现价85.50在买入区84~87(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "84~87",
"current": "盈利持有 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标96.43 | 止损81.1 | 买入区83.79~87.21 | 信号:买入",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "02202",
"name": "万科企业",
"price": 2.27,
"flags": [
"[STRATEGY_STALE] 信号不良(timing_signal含['弱势持有'])",
"现价2.27在买入区2~2(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "2~2",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.6),谨慎买入 | 量价背离 | 近5日减量涨价=⬆量价背离 | 目标2.43 | 止损2.17 | 买入区2.22~2.27 | 信号:弱势持有",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "300124",
"name": "汇川技术",
"price": 63.2,
"flags": [
"现价63.20在买入区62~64(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "62~64",
"current": "盈利持有 | 放量下跌⚠️ | 近5日增量跌价=⚠️出货型 | 目标75.61 | 止损61.3 | 买入区61.94~64.46 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "300308",
"name": "中际旭创",
"price": 1128.35,
"flags": [
"现价1128.35在买入区1106~1139(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "1106~1139",
"current": "盈利持有 | 正常 | 目标1205.48 | 止损1094.5 | 买入区1105.78~1138.89",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "301308",
"name": "江波龙",
"price": 592.71,
"flags": [
"现价592.71在买入区581~605(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-08 15:02:12",
"entry_zone": "581~605",
"current": "盈利持有 | 正常 | 目标741.03 | 止损572.25 | 买入区580.86~604.56",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "600519",
"name": "贵州茅台",
"price": 1199.3,
"flags": [
"[STRATEGY_STALE] 信号不良(timing_signal含['弱势持有'])",
"现价1199.30在买入区1175~1204(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "1175~1204",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.8),谨慎买入 | 正常 | 目标1265.1 | 止损1163.32 | 买入区1175.31~1204.03 | 信号:弱势持有",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "601101",
"name": "昊华能源",
"price": 12.23,
"flags": [
"现价12.23在买入区12~12(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-08 15:02:12",
"entry_zone": "12~12",
"current": "盈利持有 | 目标13.35 | 止损11.75 | 买入区11.99~12.39",
"age_days": 6,
"last_update": "2026-07-10 11:45:31",
"entry_zone": "86~88",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.8),谨慎买入 | 正常 | 目标92.65 | 止损85.17 | 买入区86.04~88.16",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
@@ -237,12 +83,12 @@
"name": "中国平安",
"price": 49.54,
"flags": [
"现价49.54远低于买入区95~99,买入区需下移"
"现价49.54在买入区49~50(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "95~99",
"current": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 量价背离 | 近5日减量涨价=⬆量价背离 | 目标51.96 | 止损参考0.0 | 买入区0.0~0.0 | 信号:弱势持有",
"last_update": "2026-07-16 09:33:23",
"entry_zone": "49~50",
"current": "盈利持有 | 量价背离 | 近5日减量涨价=⬆量价背离 | 目标53.52 | 止损48.05 | 买入区48.55~50.24 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
@@ -252,72 +98,284 @@
"name": "豪威集团",
"price": 100.95,
"flags": [
"现价100.95在买入区99~101(是否可买需结合timing_signal判断)"
"现价100.95在买入区99~103(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-08 15:02:12",
"entry_zone": "99~101",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.7),谨慎买入 | 正常 | 目标106.95 | 止损97.48 | 买入区98.93~101.27 | 信号:买入",
"age_days": 3,
"last_update": "2026-07-13 09:51:37",
"entry_zone": "99~103",
"current": "盈利持有 | 正常 | 目标110.59 | 止损97.92 | 买入区98.93~102.97 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688041",
"name": "海光信息",
"price": 343.0,
"code": "688372",
"name": "伟测科技",
"price": 138.19,
"flags": [
"现价343.00在买入区336~350(是否可买需结合timing_signal判断)"
"现价138.19在买入区135~141(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-08 15:32:16",
"entry_zone": "336~350",
"current": "盈利持有 | 正常 | 目标375.46 | 止损332.71 | 买入区336.14~349.81 | 信号:关注",
"last_update": "2026-07-17 08:11:34",
"entry_zone": "135~141",
"current": "盈利持有 | 缩量 | 目标175.69 | 止损133.5 | 买入区135.43~140.95",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688411",
"name": "海博思创",
"price": 244.0,
"code": "688439",
"name": "振华风光",
"price": 42.0,
"flags": [
"现价244.00在买入区239~249(是否可买需结合timing_signal判断)"
"现价42.00在买入区41~42(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "239~249",
"current": "盈利持有 | 正常 | 目标273.42 | 止损236.57 | 买入区239.12~248.88",
"last_update": "2026-07-17 08:11:34",
"entry_zone": "41~42",
"current": "盈利持有 | 缩量 | 目标44.77 | 止损40.74 | 买入区41.16~42.35 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688630",
"name": "芯碁微装",
"price": 473.26,
"code": "688475",
"name": "萤石网络",
"price": 27.15,
"flags": [
"现价473.26在买入区464~483(是否可买需结合timing_signal判断)"
"现价27.15在买入区27~27(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "464~483",
"current": "盈利持有 | 正常 | 目标530.49 | 止损451.28 | 买入区463.79~482.73",
"last_update": "2026-07-17 08:11:34",
"entry_zone": "27~27",
"current": "盈利持有 | 正常 | 目标29.04 | 止损26.34 | 买入区26.61~27.42 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688639",
"name": "华恒生物",
"price": 16.42,
"code": "688501",
"name": "青达环保",
"price": 17.61,
"flags": [
"现价16.42在买入区16~16(是否可买需结合timing_signal判断)"
"[STRATEGY_STALE] 信号不良(timing_signal含['弱势持有'])",
"[STRATEGY_STALE] 盈亏比不足(RR=1.49)或无止盈",
"现价17.61在买入区17~18(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "16~16",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.8),谨慎买入 | 缩量 | 目标17.32 | 止损15.93 | 买入区16.09~16.49 | 信号:关注",
"last_update": "2026-07-17 08:11:34",
"entry_zone": "17~18",
"current": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 缩量 | 目标18.4 | 止损17.08 | 买入区17.26~17.61 | 信号:弱势持有",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688510",
"name": "航亚科技",
"price": 22.21,
"flags": [
"现价22.21在买入区22~23(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "22~23",
"current": "盈利持有 | 缩量 | 目标24.28 | 止损21.44 | 买入区21.77~22.58",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688513",
"name": "苑东生物",
"price": 58.58,
"flags": [
"现价58.58在买入区57~60(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "57~60",
"current": "盈利持有 | 正常 | 目标67.06 | 止损56.66 | 买入区57.41~59.75",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688518",
"name": "联赢激光",
"price": 19.48,
"flags": [
"现价19.48在买入区19~20(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "19~20",
"current": "盈利持有 | 缩量 | 目标22.25 | 止损18.9 | 买入区19.09~19.87",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688533",
"name": "上声电子",
"price": 21.55,
"flags": [
"现价21.55在买入区21~22(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "21~22",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.6),谨慎买入 | 量价背离 | 近5日减量涨价=⬆量价背离 | 目标22.58 | 止损20.9 | 买入区21.12~21.57",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688566",
"name": "吉贝尔",
"price": 27.0,
"flags": [
"现价27.00在买入区26~27(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "26~27",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.9),谨慎买入 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标28.55 | 止损26.19 | 买入区26.46~27.13 | 信号:买入",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688582",
"name": "芯动联科",
"price": 43.56,
"flags": [
"现价43.56在买入区43~44(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "43~44",
"current": "盈利持有 | 缩量 | 目标52.37 | 止损42.12 | 买入区42.69~44.43",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688588",
"name": "凌志软件",
"price": 9.02,
"flags": [
"现价9.02在买入区9~9(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "9~9",
"current": "盈利持有 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标9.63 | 止损8.75 | 买入区8.84~9.1",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688621",
"name": "阳光诺和",
"price": 60.07,
"flags": [
"现价60.07在买入区59~61(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "59~61",
"current": "盈利持有 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标69.6 | 止损56.75 | 买入区58.87~61.27",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688692",
"name": "达梦数据",
"price": 229.43,
"flags": [
"现价229.43在买入区225~234(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "225~234",
"current": "盈利持有 | 缩量 | 目标250.08 | 止损222.55 | 买入区224.84~233.56 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688696",
"name": "极米科技",
"price": 66.98,
"flags": [
"现价66.98在买入区66~68(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "66~68",
"current": "盈利持有 | 量价齐升(建仓特征) | 近5日增量涨价=建仓型 | 目标71.83 | 止损64.97 | 买入区65.64~67.71 | 信号:买入",
"updated_by": null,
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688708",
"name": "佳驰科技",
"price": 46.1,
"flags": [
"现价46.10在买入区45~46(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "45~46",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.8),谨慎买入 | 缩量回踩(洗盘末端) | 近5日减量跌价=洗盘特征 | 目标48.57 | 止损44.72 | 买入区45.18~46.26 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688772",
"name": "珠海冠宇",
"price": 15.59,
"flags": [
"现价15.59在买入区15~16(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "15~16",
"current": "盈利持有 | 缩量 | 目标16.81 | 止损15.11 | 买入区15.28~15.79",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688778",
"name": "厦钨新能",
"price": 46.28,
"flags": [
"现价46.28在买入区45~47(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "45~47",
"current": "盈利持有 | 正常 | 目标50.27 | 止损44.89 | 买入区45.35~47.04 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688779",
"name": "五矿新能",
"price": 7.01,
"flags": [
"现价7.01在买入区7~7(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-17 08:11:34",
"entry_zone": "7~7",
"current": "盈利持有 | 缩量 | 目标7.6 | 止损6.8 | 买入区6.87~7.12 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
@@ -329,10 +387,10 @@
"flags": [
"现价666.00在买入区653~679(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"age_days": 6,
"last_update": "2026-07-10 21:09:43",
"entry_zone": "653~679",
"current": "盈利持有 | 正常 | 目标748.0 | 止损646.0 | 买入区652.68~679.32",
"current": "盈利持有 | 正常 | 目标788.13 | 止损646.02 | 买入区652.68~679.32 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
@@ -342,40 +400,25 @@
"name": "沐曦股份-U",
"price": 840.08,
"flags": [
"现价840.08在买入区830~851(是否可买需结合timing_signal判断)"
"现价840.08在买入区823~848(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "830~851",
"current": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 正常 | 目标1000.79 | 止损参考0.0 | 买入区0.0~0.0 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688981",
"name": "中芯国际",
"price": 152.1,
"flags": [
"现价152.10在买入区149~152(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-07-09 08:55:21",
"entry_zone": "149~152",
"current": "盈利持有 | ⚠️盈亏比偏低(1:1.6),谨慎买入 | 正常 | 目标164.94 | 止损144.14 | 买入区149.06~152.46 | 信号:买入",
"last_update": "2026-07-16 09:32:17",
"entry_zone": "823~848",
"current": "盈利持有 | 正常 | 目标898.74 | 止损814.88 | 买入区823.28~848.42 | 信号:关注",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true
}
],
"portfolio": {
"position_pct": 65.77,
"position_pct": 66.53,
"cash": 321271.0,
"weak_position_pct": 81.8,
"all_weak_pct": 45.9,
"weak_position_pct": 63.2,
"all_weak_pct": 56.9,
"signals": [
"[PORTFOLIO_WEAK] 组合中弱势+深套分类持仓占比81.8%>40%,建议系统性减仓"
"[PORTFOLIO_WEAK] 组合中弱势+深套分类持仓占比63.2%>40%,建议系统性减仓"
]
},
"summary": "扫描37个策略,24个需关注"
"summary": "扫描58个策略,27个需关注"
}
+23
View File
@@ -259,3 +259,26 @@ slixmpp ClientXMPP的`auto_reconnect`属性默认为False。断线(connection_
### 文件
- Modified: /home/hmo/xmpp_agent_core.py
- Stopped: systemctl stop xmpp-zhiwei.service (2276失败重启)
## [2026-07-14 11:00] divergence_detector 修复 — 改用新浪API直取指数数据
### 发现问题
- divergence_detector.py 的 `fetch_indices()` 使用 `mo_data.get_prices_batch()` 获取指数行情
-`mo_data` 仅支持个股代码,不支持指数代码(sh000001/hkHSI等)
- 导致 `get_prices_batch()` 返回空字典 → `fetch_indices()` return {} → main() 提前返回
- 后果:macro_divergence_state.json 自2026-07-08起连续6天未更新
### 修复内容
- **文件**: `scripts/divergence_detector.py` (MoFin + profile副本已同步)
- **修改**: 重写 `fetch_indices()`,从 mo_data 调用改为直接调用新浪API(hq.sinajs.cn)
- **细节**:
- 8个指数用sina_map映射到新浪API的代码格式
- A股指数解析 fields[3] 为 change_pct
- 港股指数解析 fields[8] 为 change_pct(之前写错了 index=7,误读为涨跌额)
- **清理**: 移除不再使用的 `from mo_data import get_price, get_prices_batch`
- **commit**: d972553
### 验证
- divergence_detector.py 手动运行正常输出
- macro_divergence_state.json 已更新到 2026-07-14 11:07,包含8个指数实时数据
- state 自动检测到科创50(-4.2%) vs 恒指(-0.7%) MEDIUM背离信号
+3 -1
View File
@@ -38,6 +38,7 @@ def main():
cash = 0.0
total_assets = 0
market_value = 0
frozen_cash = 0.0
args = sys.argv[1:]
for i, a in enumerate(args):
@@ -47,6 +48,8 @@ def main():
total_assets = float(args[i + 1])
elif a == '--mv' and i + 1 < len(args):
market_value = float(args[i + 1])
elif a == '--frozen' and i + 1 < len(args):
frozen_cash = float(args[i + 1])
with open(STOCKS_FILE, 'r', encoding='gbk') as f:
reader = csv.reader(f, delimiter='\t')
@@ -100,7 +103,6 @@ def main():
# Use provided values or calculate (unified formula includes frozen_cash)
if total_assets <= 0:
frozen_cash = float(args.get('frozen', pf.get('frozen_cash', 0)) or 0)
total_assets = total_mv_cny + cash + frozen_cash
if market_value <= 0:
market_value = round(total_mv_cny, 2)
+3 -3
View File
@@ -90,12 +90,12 @@ STRATEGY_QUALITY_GATES = [
"severity": "HIGH",
"fix": "设置 d['currency']='HKD'"
},
# --- 第4条 CRITICAL 红线:9维交叉验证 (2026-07-02 Dad要求) ---
# --- 第4条 CRITICAL 红线:12维交叉验证 (3横×4纵) ---
# 策略不能只有价格数字,必须有证据经过了多维分析:
# 横切面: 大盘+行业+个股 | 纵切面: 基本面+消息面+技术面+资金流
# 代码层面可验证: sector_context(行业) + signal_factors(多因子) 或 tech_snapshot
{
"id": "GATE_9D_ANALYSIS",
"id": "GATE_12D_ANALYSIS",
"desc": "策略必须经过多维分析(sector_context + signal_factors)",
"check": lambda d: (
bool(d.get("sector_context") and str(d.get("sector_context","")).strip() not in ("neutral","","N/A","-"))
@@ -245,7 +245,7 @@ def enforce_strategy_quality(code, name, result):
result["entry_high"] = round(p * 1.10, 2)
print(f" R{round_num} 买入区={result['entry_low']}~{result['entry_high']}", flush=True)
if gate_id == "GATE_9D_ANALYSIS":
if gate_id == "GATE_12D_ANALYSIS":
# 行业
if not result.get("sector_context") or str(result.get("sector_context","")).strip() in ("neutral","","N/A","-"):
sec = _db_sector()
+15 -2
View File
@@ -177,8 +177,8 @@ def audit_pipeline():
"SELECT MAX(created_at) FROM macro_context_log", 1), # 1天内
("市场快照", "market_watch(每10分)", "market_snapshots.created_at",
"SELECT MAX(created_at) FROM market_snapshots", 1),
("策略评估", "reassess_with_context", "strategy_evaluations.created_at",
"SELECT MAX(created_at) FROM strategy_evaluations", 2),
("策略评估", "reassess_with_context", "holding_strategies.updated_at(活跃策略)",
"SELECT MAX(updated_at) FROM holding_strategies WHERE status='active'", 2),
("原始新闻", "macro_context_collector", "macro_raw_news.fetched_at",
"SELECT MAX(fetched_at) FROM macro_raw_news", 1),
("风险信号", "macro_context_collector", "signal_news.created_at",
@@ -189,6 +189,13 @@ def audit_pipeline():
try:
row = conn.execute(sql).fetchone()
if not row or not row[0]:
# 特殊处理:收盘后价格数据停止更新是正常行为
if name == "价格数据":
now = datetime.now()
# 如果是非交易时段(9:30-15:00之外),不做无数据告警
if now.hour < 9 or now.hour >= 15 or (now.hour == 9 and now.minute < 30):
log_ok("数据管道", f"{name} 收盘后正常停止 → OK (最后已更新)")
continue
log_issue("数据管道", "HIGH", f"{name}: 无数据 ({producer}{storage})",
fix=f"检查{producer}是否正确运行")
continue
@@ -199,6 +206,12 @@ def audit_pipeline():
except:
days_old = 999
if days_old > max_days:
# 收盘后价格数据停止更新是正常行为,放松阈值
if name == "价格数据":
now = datetime.now()
if now.hour < 9 or now.hour >= 15 or (now.hour == 9 and now.minute < 30):
log_ok("数据管道", f"{name} {days_old*24:.0f}小时前更新(收盘后正常) → OK")
continue
log_issue("数据管道", "HIGH",
f"{name}: {days_old:.0f}天未更新(阈值{max_days}天) 最后{latest} ({producer}{storage})",
fix=f"检查{producer}输出和{storage}写入逻辑")
+310 -403
View File
File diff suppressed because it is too large Load Diff