feat: xmpp bot最终修复版+skill文档同步

xmpp_agent_core.py 当前工作配置记录:
1. send_presence() — presence = available, 否则私聊进离线
2. 入站消息队列(_inbound_queue) — 崩了不丢, 重试3次
3. 出站队列(_outbound_queue) — 崩了自动重启
4. XMPP心跳检测(xep_0199 ping) — run_filters死后15s内重连
5. 私聊回复双通道: send_message(指定resource) + send_stanza(裸JID)
6. AGENT_MENTION动态解析(群聊@知微识别)
7. session_id保持xmpp-zhiwei-v2不变(不因重启换session)
8. 断线重连2秒延迟(防资源冲突)
This commit is contained in:
知微
2026-06-26 23:17:21 +08:00
parent ef7c83a3ed
commit 40d74f89ff
22 changed files with 27418 additions and 6538 deletions
Binary file not shown.
+22904 -615
View File
File diff suppressed because it is too large Load Diff
+690 -690
View File
File diff suppressed because it is too large Load Diff
+101 -129
View File
@@ -1,200 +1,172 @@
{ {
"updated_at": "2026-06-25 12:00:51", "updated_at": "2026-06-26 12:00:55",
"data_timestamp": "2026-06-25 12:00:00", "data_timestamp": "2026-06-26 12:00:00",
"session": "midday", "session": "midday",
"has_valid_data": true, "has_valid_data": true,
"indices": { "indices": {
"上证指数": { "上证指数": {
"price": 4125.76, "price": 4032.3,
"change_pct": 0.36, "change_pct": -2.14,
"high": 4133.1, "high": 4099.78,
"low": 4093.01 "low": 4007.86
}, },
"深证成指": { "深证成指": {
"price": 16285.83, "price": 15846.98,
"change_pct": 1.46, "change_pct": -3.04,
"high": 16303.39, "high": 16215.45,
"low": 16058.85 "low": 15728.84
}, },
"创业板指": { "创业板指": {
"price": 4336.74, "price": 4209.29,
"change_pct": 2.01, "change_pct": -3.72,
"high": 4338.71, "high": 4328.7,
"low": 4242.86 "low": 4175.38
}, },
"科创50": { "科创50": {
"price": 2072.5, "price": 2012.53,
"change_pct": 4.18, "change_pct": -2.6,
"high": 2076.88, "high": 2076.47,
"low": 2000.8 "low": 1976.92
}, },
"恒生指数": { "恒生指数": {
"price": 23038.52, "price": 22558.32,
"change_pct": -1.6, "change_pct": -2.25,
"high": 23388.5, "high": 22962.46,
"low": 23004.75 "low": 22518.0
}, },
"国企指数": { "国企指数": {
"price": 7601.15, "price": 7420.42,
"change_pct": -2.11, "change_pct": -2.47,
"high": 7757.49, "high": 7575.18,
"low": 7583.03 "low": 7404.47
} }
}, },
"structure": { "structure": {
"overall": "strong_bullish", "overall": "strong_bearish",
"description": "科技成长领涨" "description": "权重护盘"
}, },
"key_sectors": [ "key_sectors": [
{ {
"name": "国证芯片", "name": "新能电池",
"change_pct": 5.17 "change_pct": -4.29
},
{
"name": "上证信息",
"change_pct": 4.32
}, },
{ {
"name": "机器人产业", "name": "机器人产业",
"change_pct": -1.11 "change_pct": -3.69
}, },
{ {
"name": "通用航空", "name": "上证信息",
"change_pct": -1.05 "change_pct": -3.39
}, },
{ {
"name": "上证资源", "name": "上证资源",
"change_pct": -0.88 "change_pct": -2.72
}, },
{ {
"name": "新能电池", "name": "国证芯片",
"change_pct": -0.38 "change_pct": -2.35
}, },
{ {
"name": "上证周期", "name": "上证周期",
"change_pct": -0.22 "change_pct": -1.98
}, },
{ {
"name": "治理指数", "name": "治理指数",
"change_pct": -0.13 "change_pct": -1.95
},
{
"name": "通用航空",
"change_pct": -1.75
} }
], ],
"top_gainers": [ "top_gainers": [
{ {
"name": "机场航运", "name": "教育",
"code": "", "code": "",
"price": 0, "price": 0,
"change": 4.26, "change": 1.49,
"volume": 1319.21, "volume": 255.83,
"turnover": 65.18, "turnover": 10.42,
"net_inflow": 13.1, "net_inflow": -0.05,
"up_count": 13, "up_count": 6,
"down_count": 0, "down_count": 8,
"avg_price": 4.94, "avg_price": 4.07,
"lead_stock": "华夏航空", "lead_stock": "*ST开元",
"lead_stock_change": 10.03 "lead_stock_change": 20.16
}, },
{ {
"name": "保险", "name": "光学光电子",
"code": "", "code": "",
"price": 0, "price": 0,
"change": 3.56, "change": 0.44,
"volume": 348.27, "volume": 9368.72,
"turnover": 106.54, "turnover": 1206.67,
"net_inflow": 6.75, "net_inflow": 14.68,
"up_count": 5,
"down_count": 0,
"avg_price": 30.59,
"lead_stock": "中国人保",
"lead_stock_change": 5.63
},
{
"name": "证券",
"code": "",
"price": 0,
"change": 3.31,
"volume": 5369.91,
"turnover": 678.34,
"net_inflow": 62.2,
"up_count": 50, "up_count": 50,
"down_count": 0, "down_count": 56,
"avg_price": 12.63, "avg_price": 12.88,
"lead_stock": "中信建投", "lead_stock": "惠科股份",
"lead_stock_change": 9.99 "lead_stock_change": 376.88
}, },
{ {
"name": "元件", "name": "养殖业",
"code": "", "code": "",
"price": 0, "price": 0,
"change": 2.55, "change": 0.42,
"volume": 1951.11, "volume": 584.35,
"turnover": 1357.67, "turnover": 58.7,
"net_inflow": 87.09, "net_inflow": 1.91,
"up_count": 42, "up_count": 17,
"down_count": 20, "down_count": 16,
"avg_price": 69.58, "avg_price": 10.04,
"lead_stock": "中京电子", "lead_stock": "神农集团",
"lead_stock_change": 10.02 "lead_stock_change": 10.02
},
{
"name": "白酒",
"code": "",
"price": 0,
"change": 2.25,
"volume": 210.31,
"turnover": 122.56,
"net_inflow": 8.5,
"up_count": 18,
"down_count": 1,
"avg_price": 58.28,
"lead_stock": "酒鬼酒",
"lead_stock_change": 7.88
} }
], ],
"top_losers": [ "top_losers": [
{ {
"name": "金属", "name": "能源金属",
"code": "", "code": "",
"price": 0, "price": 0,
"change": -3.86, "change": -5.64,
"volume": 933.0, "volume": 358.04,
"turnover": 231.38, "turnover": 201.43,
"net_inflow": -19.5, "net_inflow": -21.73,
"up_count": 0, "up_count": 1,
"down_count": 14, "down_count": 11,
"avg_price": 24.8, "avg_price": 56.26,
"lead_stock": "株冶集团", "lead_stock": "博迁新材",
"lead_stock_change": -1.23 "lead_stock_change": 4.14
}, },
{ {
"name": "教育", "name": "通信设备",
"code": "", "code": "",
"price": 0, "price": 0,
"change": -2.98, "change": -5.09,
"volume": 223.13, "volume": 2028.1,
"turnover": 10.17, "turnover": 1978.16,
"net_inflow": -1.14, "net_inflow": -237.95,
"up_count": 2, "up_count": 7,
"down_count": 13, "down_count": 84,
"avg_price": 4.56, "avg_price": 97.54,
"lead_stock": "*ST高科", "lead_stock": "信科移动",
"lead_stock_change": 2.02 "lead_stock_change": 8.05
}, },
{ {
"name": "农化制品", "name": "电池",
"code": "", "code": "",
"price": 0, "price": 0,
"change": -2.69, "change": -4.42,
"volume": 1142.32, "volume": 1981.51,
"turnover": 172.6, "turnover": 792.68,
"net_inflow": -15.41, "net_inflow": -101.69,
"up_count": 3, "up_count": 5,
"down_count": 58, "down_count": 100,
"avg_price": 15.11, "avg_price": 40.0,
"lead_stock": "兴发集团", "lead_stock": "信德新材",
"lead_stock_change": 3.13 "lead_stock_change": 20.0
} }
], ],
"sector_up_ratio": 11.1, "sector_up_ratio": 3.3,
"sector_mood": "bearish" "sector_mood": "bearish"
} }
+1304 -1464
View File
File diff suppressed because it is too large Load Diff
+141 -611
View File
@@ -4,691 +4,221 @@
"code": "300308", "code": "300308",
"name": "中际旭创", "name": "中际旭创",
"shares": 100, "shares": 100,
"cost": 1316.53, "price": 1253.89,
"position_pct": 12.27, "cost_price": 1316.53,
"is_active": 1, "currency": "CNY",
"stop_loss": 1179.31, "market_val": 125389.0,
"take_profit": 1496.62, "cost_amount": 131653.33,
"entry_low": 1287.25, "exchange_rate": 0.8664
"entry_high": 1316.17,
"action": null,
"strategy_updated": null,
"analysis": {
"stop_loss": 1179.31,
"take_profit": 1496.62,
"entry_low": 1287.25,
"entry_high": 1316.17,
"action": "盈利持有 | ⚠️盈亏比偏低(1:0.9),不建议加仓 | 止损1179.31 | 目标1496.62 | 买入区1287.25~1316.17 | 信号:持有",
"tech_snapshot": "形态:锤子线/T字线/neutral 量价:主动买盘占优 强撑:1179.31 弱撑:1287.25 弱压:1352.32 强压:1453.03",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 0.9,
"action_note": "⚠️盈亏比偏低(1:0.9),不建议加仓",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 1179.31,
"entry_zone": "1287.25~1316.17",
"take_profit_zone": "0~1496.62"
},
"price": 1323.4,
"change_pct": 0.86
}, },
{ {
"code": "06869", "code": "06869",
"name": "长飞光纤光缆", "name": "长飞光纤光缆",
"shares": 500, "shares": 500,
"cost": 263.45, "price": 250.6,
"position_pct": 11.43, "cost_price": 263.69,
"is_active": 1, "currency": "HKD",
"stop_loss": 264.65, "market_val": 108722.81,
"take_profit": 381.85, "cost_amount": 114403.43,
"entry_low": 261.2, "exchange_rate": 0.8677
"entry_high": 274.26,
"action": null,
"strategy_updated": null,
"analysis": {
"stop_loss": 264.65,
"take_profit": 381.85,
"entry_low": 261.2,
"entry_high": 274.26,
"action": "盈利良好 | 止损264.65 | 目标381.85 | 买入区261.2~274.26 | 信号:持有",
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:数据不足 强撑:193.13 弱撑:261.2 弱压:293.07 强压:370.73",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 5.82,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 264.65,
"entry_zone": "261.2~274.26",
"take_profit_zone": "0~381.85"
},
"price": 287.6,
"change_pct": 10.11
}, },
{ {
"code": "01478", "code": "01478",
"name": "丘钛科技", "name": "丘钛科技",
"shares": 11000, "shares": 11000,
"cost": 13.77, "price": 6.86,
"position_pct": 6.37, "cost_price": 13.46,
"is_active": 1, "currency": "HKD",
"stop_loss": 4.9, "market_val": 65476.64,
"take_profit": 10.0, "cost_amount": 128509.38,
"entry_low": 6.44, "exchange_rate": 0.8677
"entry_high": 7.52,
"action": "深套持有 | 深套持有 | 止损7.33 | 目标10.39 | 买入区7.88~9.19 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 4.9,
"take_profit": 10.0,
"entry_low": 6.44,
"entry_high": 7.52,
"action": "深套持有 | 深套持有 | 止损4.9 | 目标10.0 | 买入区6.44~7.52 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:5.05 弱撑:6.89 弱压:7.69 强压:9.71",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 1.21,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 4.9,
"entry_zone": "6.44~7.52",
"take_profit_zone": "0~10.0"
},
"price": 7.2,
"change_pct": -6.37
}, },
{ {
"code": "601899", "code": "601899",
"name": "紫金矿", "name": "XD紫金矿",
"shares": 2400, "shares": 2400,
"cost": 40.27, "price": 25.1,
"position_pct": 5.77, "cost_price": 39.89,
"is_active": 1, "currency": "CNY",
"stop_loss": 20.51, "market_val": 60240.0,
"take_profit": 29.76, "cost_amount": 95732.29,
"entry_low": 23.33, "exchange_rate": 0.8664
"entry_high": 27.22,
"action": "深套持有 | 深套持有 | 止损24.48 | 目标34.47 | 买入区26.72~31.17 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 20.51,
"take_profit": 29.76,
"entry_low": 23.33,
"entry_high": 27.22,
"action": "深套持有 | 深套持有 | 止损20.51 | 目标29.76 | 买入区23.33~27.22 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动买盘占优 强撑:24.89 弱撑:25.51 弱压:27.65 强压:30.42",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 1.16,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 20.51,
"entry_zone": "23.33~27.22",
"take_profit_zone": "0~29.76"
},
"price": 25.92,
"change_pct": -6.26
}, },
{ {
"code": "688411", "code": "688411",
"name": "海博思创", "name": "海博思创",
"shares": 200, "shares": 200,
"cost": 266.95, "price": 258.88,
"position_pct": 5.17, "cost_price": 266.95,
"is_active": 1, "currency": "CNY",
"stop_loss": 222.3, "market_val": 51776.0,
"take_profit": 327.81, "cost_amount": 53389.21,
"entry_low": 263.83, "exchange_rate": 0.8664
"entry_high": 273.72,
"action": "盈利良好 | 止损253.82 | 目标316.5 | 买入区273.21~286.87 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 222.3,
"take_profit": 327.81,
"entry_low": 263.83,
"entry_high": 273.72,
"action": "盈利持有 | ⚠️盈亏比偏低(1:0.9),不建议加仓 | 止损222.3 | 目标327.81 | 买入区263.83~273.72 | 信号:持有",
"tech_snapshot": "形态:带上影阳线/neutral 量价:买卖均衡 强撑:229.18 弱撑:263.83 弱压:285.77 强压:318.26",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 0.91,
"action_note": "⚠️盈亏比偏低(1:0.9),不建议加仓",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 222.3,
"entry_zone": "263.83~273.72",
"take_profit_zone": "0~327.81"
},
"price": 275.89,
"change_pct": 3.64
},
{
"code": "688639",
"name": "华恒生物",
"shares": 2800,
"cost": 21.51,
"position_pct": 4.47,
"is_active": 1,
"stop_loss": 10.96,
"take_profit": 21.98,
"entry_low": 15.41,
"entry_high": 17.98,
"action": null,
"strategy_updated": null,
"analysis": {
"stop_loss": 10.96,
"take_profit": 21.98,
"entry_low": 15.41,
"entry_high": 17.98,
"action": "深套持有 | 深套持有 | 止损10.96 | 目标21.98 | 买入区15.41~17.98 | 信号:持有",
"tech_snapshot": "形态:平盘/neutral 量价:主动买盘占优 强撑:11.77 弱撑:17.12 弱压:21.4 强压:22.47",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 1.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 10.96,
"entry_zone": "15.41~17.98",
"take_profit_zone": "0~21.98"
},
"price": 17.12,
"change_pct": 0
}, },
{ {
"code": "688981", "code": "688981",
"name": "中芯国际", "name": "中芯国际",
"shares": 300, "shares": 300,
"cost": 126.07, "price": 148.76,
"position_pct": 4.34, "cost_price": 126.07,
"is_active": 1, "currency": "CNY",
"stop_loss": 149.92, "market_val": 44628.0,
"take_profit": 187.3, "cost_amount": 37820.42,
"entry_low": 151.53, "exchange_rate": 0.8664
"entry_high": 159.11, },
"action": "盈利良好 | 止损132.76 | 目标164.45 | 买入区134.18~140.89 | 信号:持有", {
"strategy_updated": "2026-06-19 16:01", "code": "688639",
"analysis": { "name": "华恒生物",
"stop_loss": 149.92, "shares": 2800,
"take_profit": 187.3, "price": 15.4,
"entry_low": 151.53, "cost_price": 21.51,
"entry_high": 159.11, "currency": "CNY",
"action": "盈利良好 | 止损149.92 | 目标187.3 | 买入区151.53~159.11 | 信号:持有", "market_val": 43120.0,
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:买卖均衡 强撑:121.22 弱撑:151.53 弱压:160.01 强压:181.84", "cost_amount": 60223.75,
"reassessed_at": "2026-06-25 16:19", "exchange_rate": 0.8664
"status": "updated",
"rr_ratio": 4.69,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 149.92,
"entry_zone": "151.53~159.11",
"take_profit_zone": "0~187.3"
},
"price": 156.86,
"change_pct": 3.52
}, },
{ {
"code": "01888", "code": "01888",
"name": "建滔积层板", "name": "建滔积层板",
"shares": 500, "shares": 500,
"cost": 88.14, "price": 98.55,
"position_pct": 4.11, "cost_price": 88.22,
"is_active": 1, "currency": "HKD",
"stop_loss": 100.82, "market_val": 42755.92,
"take_profit": 154.65, "cost_amount": 38275.35,
"entry_low": 93.55, "exchange_rate": 0.8677
"entry_high": 98.23,
"action": "盈利持有 | 短炒强趋势持 | 止损86.34 | 目标141.9 | 买入区85.82~90.11 | 信号:强趋势持",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 100.82,
"take_profit": 154.65,
"entry_low": 93.55,
"entry_high": 98.23,
"action": "盈利良好 | 止损100.82 | 目标154.65 | 买入区93.55~98.23 | 信号:持有",
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:数据不足 强撑:58.38 弱撑:93.55 弱压:109.32 强压:145.78",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 7.98,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 100.82,
"entry_zone": "93.55~98.23",
"take_profit_zone": "0~154.65"
},
"price": 104.2,
"change_pct": 11.38
},
{
"code": "02388",
"name": "中银香港",
"shares": 1000,
"cost": 43.67,
"position_pct": 3.73,
"is_active": 1,
"stop_loss": 43.58,
"take_profit": 51.61,
"entry_low": 45.86,
"entry_high": 47.52,
"action": "盈利良好 | 止损43.49 | 目标50.1 | 买入区47.51~48.95 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 43.58,
"take_profit": 51.61,
"entry_low": 45.86,
"entry_high": 47.52,
"action": "盈利良好 | 止损43.58 | 目标51.61 | 买入区45.86~47.52 | 信号:持有",
"tech_snapshot": "形态:带下影阴线/neutral 量价:数据不足 强撑:42.69 弱撑:45.86 弱压:46.86 强压:50.11",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 2.73,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 43.58,
"entry_zone": "45.86~47.52",
"take_profit_zone": "0~51.61"
},
"price": 46.32,
"change_pct": -0.43
}, },
{ {
"code": "300750", "code": "300750",
"name": "宁德时代", "name": "宁德时代",
"shares": 100, "shares": 100,
"cost": 401.78, "price": 381.0,
"position_pct": 3.72, "cost_price": 401.78,
"is_active": 1, "currency": "CNY",
"stop_loss": 342.93, "market_val": 38100.0,
"take_profit": 420.51, "cost_amount": 40178.03,
"entry_low": 395.36, "exchange_rate": 0.8664
"entry_high": 399.01,
"action": "持有观察 | 止损345.04 | 目标414.6 | 买入区384.35~397.12 | 信号:弱势持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 342.93,
"take_profit": 420.51,
"entry_low": 395.36,
"entry_high": 399.01,
"action": "盈利持有 | ⚠️盈亏比偏低(1:0.8),不建议加仓 | 止损342.93 | 目标420.51 | 买入区395.36~399.01 | 信号:弱势持有",
"tech_snapshot": "形态:锤子线/T字线/bullish 量价:买卖均衡 强撑:368.27 弱撑:395.36 弱压:405.44 强压:429.75",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 0.83,
"action_note": "⚠️盈亏比偏低(1:0.8),不建议加仓",
"timing_signal": "弱势持有"
},
"trigger": {
"stop_loss": 342.93,
"entry_zone": "395.36~399.01",
"take_profit_zone": "0~420.51"
},
"price": 401.9,
"change_pct": 1.65
}, },
{ {
"code": "01211", "code": "01211",
"name": "比亚迪股份", "name": "比亚迪股份",
"shares": 600, "shares": 600,
"cost": 104.76, "price": 72.65,
"position_pct": 3.7, "cost_price": 104.86,
"is_active": 1, "currency": "HKD",
"stop_loss": 60.41, "market_val": 37823.04,
"take_profit": 92.58, "cost_amount": 54592.42,
"entry_low": 68.58, "exchange_rate": 0.8677
"entry_high": 80.01,
"action": "深套持有 | 深套持有 | 止损63.99 | 目标87.07 | 买入区72.77~84.89 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 60.41,
"take_profit": 92.58,
"entry_low": 68.58,
"entry_high": 80.01,
"action": "深套持有 | 深套持有 | 止损60.41 | 目标92.58 | 买入区68.58~80.01 | 信号:持有",
"tech_snapshot": "形态:长影星线/neutral 量价:数据不足 强撑:62.28 弱撑:74.72 弱压:77.57 强压:89.88",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 0.98,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 60.41,
"entry_zone": "68.58~80.01",
"take_profit_zone": "0~92.58"
},
"price": 76.05,
"change_pct": 0.13
}, },
{ {
"code": "02202", "code": "02202",
"name": "万科企业", "name": "万科企业",
"shares": 19700, "shares": 19700,
"cost": 4.66, "price": 2.2,
"position_pct": 3.58, "cost_price": 4.67,
"is_active": 1, "currency": "HKD",
"stop_loss": 1.64, "market_val": 37606.12,
"take_profit": 2.7, "cost_amount": 79782.13,
"entry_low": 2.02, "exchange_rate": 0.8677
"entry_high": 2.35,
"action": "深套持有 | 深套持有 | 止损2.0 | 目标2.85 | 买入区2.18~2.54 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 1.64,
"take_profit": 2.7,
"entry_low": 2.02,
"entry_high": 2.35,
"action": "深套持有 | 深套持有 | 止损1.64 | 目标2.7 | 买入区2.02~2.35 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:1.76 弱撑:2.19 弱压:2.31 强压:2.76",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 1.08,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 1.64,
"entry_zone": "2.02~2.35",
"take_profit_zone": "0~2.7"
},
"price": 2.25,
"change_pct": -2.6
},
{
"code": "00981",
"name": "中芯国际",
"shares": 500,
"cost": 75.86,
"position_pct": 3.47,
"is_active": 1,
"stop_loss": 82.54,
"take_profit": 106.68,
"entry_low": 83.63,
"entry_high": 87.81,
"action": "盈利持有 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损67.69 | 目标87.26 | 买入区73.68~76.57 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 82.54,
"take_profit": 106.68,
"entry_low": 83.63,
"entry_high": 87.81,
"action": "盈利良好 | 止损82.54 | 目标106.68 | 买入区83.63~87.81 | 信号:持有",
"tech_snapshot": "形态:锤子线/T字线/neutral 量价:数据不足 强撑:68.77 弱撑:83.63 弱压:88.53 强压:103.57",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 6.81,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 82.54,
"entry_zone": "83.63~87.81",
"take_profit_zone": "0~106.68"
},
"price": 86.0,
"change_pct": 1.42
}, },
{ {
"code": "00700", "code": "00700",
"name": "腾讯控股", "name": "腾讯控股",
"shares": 100, "shares": 100,
"cost": 442.68, "price": 411.8,
"position_pct": 3.43, "cost_price": 443.08,
"is_active": 1, "currency": "HKD",
"stop_loss": 332.93, "market_val": 35731.89,
"take_profit": 475.48, "cost_amount": 38446.39,
"entry_low": 414.87, "exchange_rate": 0.8677
"entry_high": 421.73, },
"action": "持有观察 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损387.49 | 目标496.33 | 买入区435.13~440.67 | 信号:持有", {
"strategy_updated": "2026-06-19 16:01", "code": "00981",
"analysis": { "name": "中芯国际",
"stop_loss": 332.93, "shares": 500,
"take_profit": 475.48, "price": 80.0,
"entry_low": 414.87, "cost_price": 75.93,
"entry_high": 421.73, "currency": "HKD",
"action": "持有观察 | ⚠️盈亏比偏低(1:1.1),不建议加仓 | 止损332.93 | 目标475.48 | 买入区414.87~421.73 | 信号:持有", "market_val": 34708.0,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:357.53 弱撑:414.87 弱压:428.8 强压:485.93", "cost_amount": 32943.17,
"reassessed_at": "2026-06-25 16:19", "exchange_rate": 0.8677
"status": "updated",
"rr_ratio": 1.1,
"action_note": "⚠️盈亏比偏低(1:1.1),不建议加仓",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 332.93,
"entry_zone": "414.87~421.73",
"take_profit_zone": "0~475.48"
},
"price": 421.4,
"change_pct": -1.73
}, },
{ {
"code": "300548", "code": "300548",
"name": "长芯博创", "name": "长芯博创",
"shares": 100, "shares": 100,
"cost": 231.46, "price": 262.65,
"position_pct": 2.59, "cost_price": 231.46,
"is_active": 1, "currency": "CNY",
"stop_loss": 266.1, "market_val": 26265.0,
"take_profit": 348.84, "cost_amount": 23146.0,
"entry_low": 274.33, "exchange_rate": 0.8664
"entry_high": 288.05,
"action": "盈利良好 | 短炒强趋势持 | 止损251.24 | 目标413.9 | 买入区269.8~283.29 | 信号:强趋势持",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 266.1,
"take_profit": 348.84,
"entry_low": 274.33,
"entry_high": 288.05,
"action": "盈利良好 | 止损266.1 | 目标348.84 | 买入区274.33~288.05 | 信号:持有",
"tech_snapshot": "形态:带下影阴线/neutral 量价:主动买盘占优 强撑:225.78 弱撑:274.33 弱压:289.74 强压:338.68",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 7.5,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 266.1,
"entry_zone": "274.33~288.05",
"take_profit_zone": "0~348.84"
},
"price": 281.9,
"change_pct": -0.12
},
{
"code": "300035",
"name": "中科电气",
"shares": 1400,
"cost": 22.29,
"position_pct": 1.97,
"is_active": 1,
"stop_loss": 11.98,
"take_profit": 18.24,
"entry_low": 13.62,
"entry_high": 15.89,
"action": "深套持有 | 深套持有 | 止损13.74 | 目标19.0 | 买入区15.63~18.24 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 11.98,
"take_profit": 18.24,
"entry_low": 13.62,
"entry_high": 15.89,
"action": "深套持有 | 深套持有 | 止损11.98 | 目标18.24 | 买入区13.62~15.89 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:12.86 弱撑:14.72 弱压:16.08 强压:18.64",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 1.55,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 11.98,
"entry_zone": "13.62~15.89",
"take_profit_zone": "0~18.24"
},
"price": 15.13,
"change_pct": -5.91
}, },
{ {
"code": "518880", "code": "518880",
"name": "黄金ETF华安", "name": "黄金ETF华安",
"shares": 2400, "shares": 2400,
"cost": 12.19, "price": 8.39,
"position_pct": 1.86, "cost_price": 12.19,
"is_active": 1, "currency": "CNY",
"stop_loss": 6.28, "market_val": 20136.0,
"take_profit": 8.36, "cost_amount": 29259.64,
"entry_low": 7.46, "exchange_rate": 0.8664
"entry_high": 8.7, },
"action": "深套持有 | 深套持有 | 止损7.05 | 目标9.17 | 买入区8.02~9.35 | 信号:持有", {
"strategy_updated": "2026-06-19 16:01", "code": "300035",
"analysis": { "name": "中科电气",
"stop_loss": 6.28, "shares": 1400,
"take_profit": 8.36, "price": 14.19,
"entry_low": 7.46, "cost_price": 22.29,
"entry_high": 8.7, "currency": "CNY",
"action": "深套持有 | 深套持有 | 止损6.28 | 目标8.36 | 买入区7.46~8.7 | 信号:持有", "market_val": 19866.0,
"tech_snapshot": "形态:带下影阴线/neutral 量价:数据不足 强撑:7.66 弱撑:8.26 弱压:8.52 强压:9.02", "cost_amount": 31207.91,
"reassessed_at": "2026-06-25 16:19", "exchange_rate": 0.8664
"status": "updated",
"rr_ratio": 0.59,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 6.28,
"entry_zone": "7.46~8.7",
"take_profit_zone": "0~8.36"
},
"price": 8.29,
"change_pct": -2.68
}, },
{ {
"code": "000700", "code": "000700",
"name": "模塑科技", "name": "模塑科技",
"shares": 1400, "shares": 1400,
"cost": 14.83, "price": 14.13,
"position_pct": 1.81, "cost_price": 14.83,
"is_active": 1, "currency": "CNY",
"stop_loss": 13.91, "market_val": 19782.0,
"take_profit": 17.0, "cost_amount": 20767.0,
"entry_low": 14.53, "exchange_rate": 0.8664
"entry_high": 15.26,
"action": null,
"strategy_updated": null,
"analysis": {
"stop_loss": 13.91,
"take_profit": 17.0,
"entry_low": 14.53,
"entry_high": 15.26,
"action": "持有观察 | 止损13.91 | 目标17.0 | 买入区14.53~15.26 | 信号:持有",
"tech_snapshot": "形态:带上影阴线/bearish 量价:主动买盘占优 强撑:13.07 弱撑:13.48 弱压:14.64 强压:15.97",
"reassessed_at": "2026-06-25 16:19",
"status": "manual",
"rr_ratio": 22.39,
"action_note": "",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 13.91,
"entry_zone": "14.53~15.26",
"take_profit_zone": "0~17.0"
},
"price": 13.89,
"change_pct": -4.34
}, },
{ {
"code": "600563", "code": "600563",
"name": "法拉电子", "name": "法拉电子",
"shares": 100, "shares": 100,
"cost": 147.18, "price": 188.76,
"position_pct": 1.76, "cost_price": 147.18,
"is_active": 1, "currency": "CNY",
"stop_loss": 183.88, "market_val": 18876.0,
"take_profit": 208.62, "cost_amount": 14718.0,
"entry_low": 178.76, "exchange_rate": 0.8664
"entry_high": 187.7,
"action": "盈利良好 | 止损161.41 | 目标192.67 | 买入区165.51~173.79 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 183.88,
"take_profit": 208.62,
"entry_low": 178.76,
"entry_high": 187.7,
"action": "盈利良好 | ⚠️盈亏比偏低(1:0.7),不建议加仓 | 止损183.88 | 目标208.62 | 买入区178.76~187.7 | 信号:持有",
"tech_snapshot": "形态:带下影阳线/bullish 量价:买卖均衡 强撑:160.88 弱撑:178.76 弱压:194.74 强压:196.64",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 0.69,
"action_note": "⚠️盈亏比偏低(1:0.7),不建议加仓",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 183.88,
"entry_zone": "178.76~187.7",
"take_profit_zone": "0~208.62"
},
"price": 190.04,
"change_pct": 6.31
}, },
{ {
"code": "01088", "code": "01088",
"name": "中国神华", "name": "中国神华",
"shares": 500, "shares": 500,
"cost": 45.85, "price": 40.62,
"position_pct": 1.65, "cost_price": 45.89,
"is_active": 1, "currency": "HKD",
"stop_loss": 33.25, "market_val": 17622.99,
"take_profit": 45.04, "cost_amount": 19909.06,
"entry_low": 39.97, "exchange_rate": 0.8677
"entry_high": 40.87,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.3),不建议加仓 | 止损35.09 | 目标42.9 | 买入区41.66~42.8 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 33.25,
"take_profit": 45.04,
"entry_low": 39.97,
"entry_high": 40.87,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.2),不建议加仓 | 止损33.25 | 目标45.04 | 买入区39.97~40.87 | 信号:持有",
"tech_snapshot": "形态:带上影阴线/bearish 量价:数据不足 强撑:35.71 弱撑:39.97 弱压:41.9 强压:46.03",
"reassessed_at": "2026-06-25 16:19",
"status": "updated",
"rr_ratio": 1.2,
"action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 33.25,
"entry_zone": "39.97~40.87",
"take_profit_zone": "0~45.04"
},
"price": 40.58,
"change_pct": -3.15
} }
], ],
"cash": 69825, "cash": 22932.0,
"total_market_value": 873056.0, "cash_available": 22932.21,
"total_assets": 1077484.0, "cash_frozen": 90308.04,
"total_pl": 0, "total_market_value": 848625,
"position_pct": 93.5, "total_assets": 961866.0,
"updated_at": "2026-06-25 16:58", "today_pl": -52416.43,
"source": "/home/hmo/stocks/holding.xls", "today_pl_pct": -5.45,
"cash_available": 18971, "total_pl": -214878.85,
"cash_frozen": 50853, "position_pct": 88.23,
"stock_value": 1007659.0 "updated_at": "2026-06-26 23:05",
"source": "/home/hmo/stocks/holding.xls"
} }
File diff suppressed because it is too large Load Diff
+268 -2828
View File
File diff suppressed because it is too large Load Diff
+72 -4
View File
@@ -1,7 +1,75 @@
{ {
"code": "001309", "code": "001309",
"name": "德明利", "history": [
"status": "watchlist", {
"converted_at": "2026-06-25 13:21", "time": "2026-06-12T08:55:32.432962",
"note": "清仓转自选,价格参考: 药明康德@0 德明利@885.85" "content": "**德明利(001309)** 现价617.7 | 仓位0% | 买入区585~647,知微6/9收紧区间。存储芯片回调充分,止损523安全。",
"report_id": "cron_99c06255590a_2026-06-12_08-32-15"
},
{
"time": "2026-06-25T08:55:46.556482",
"content": "**中科电气(300035) / 德明利(001309)** — 前者能源金属+4.27%但-28%深套持有;后者半导体板块受益,+9.9%持有。",
"report_id": "cron_99c06255590a_2026-06-25_08-33-37"
},
{
"time": "2026-06-12T08:55:34.669098",
"content": "德明利(001309) 617.70(-1.63%) → 买入区585.01~646.59,现价617.70在区间内,观望等待回调至600以下",
"report_id": "cron_bb35a0b1b5e3_2026-06-11_12-55-16"
},
{
"time": "2026-06-12T08:55:34.667003",
"content": "• 德明利(001309) 626.0(-0.31%) → 买入区585~646.6,在区间内,止损523.4,可现价建仓5%",
"report_id": "cron_bb35a0b1b5e3_2026-06-11_13-43-42"
},
{
"time": "2026-06-12T08:55:34.664644",
"content": "• 德明利(001309) 631.49(+0.56%) | 买入区585~647,距上沿-2.3%可关注",
"report_id": "cron_bb35a0b1b5e3_2026-06-11_14-43-18"
},
{
"time": "2026-06-12T08:55:34.502308",
"content": "• 德明利(001309) ¥632.35(+0.70%) — 买入区585~647,在区内可关注",
"report_id": "cron_bb35a0b1b5e3_2026-06-11_15-43-25"
},
{
"time": "2026-06-01T15:56:03.416800",
"content": "👀观望 德明利(001309) | 现价597.41 | -6.65% | 存储芯片回调,买入区560-580未触及",
"report_id": "cron_d3797d924ddc_2026-06-01_15-47-55"
},
{
"time": "2026-06-12T08:55:35.655385",
"content": "• 德明利(001309) 631.01(+0.49%) 买入区585.01~646.59→在区内上沿附近,挂单615等回调",
"report_id": "cron_d3797d924ddc_2026-06-11_14-48-58"
},
{
"time": "2026-06-12T08:55:35.405159",
"content": "德明利(001309) ¥632.35(+0.37%) 买入区585.01~646.59 现价买2%|止损523.43目标708",
"report_id": "cron_d3797d924ddc_2026-06-11_15-42-35"
},
{
"time": "2026-06-12T08:55:35.356400",
"content": "**德明利(001309)** 现价632.35(+0.70%) | 买入区585~647 | 现价在区间高位,等回调至610~620再入。",
"report_id": "cron_d3797d924ddc_2026-06-11_16-03-09"
},
{
"time": "2026-06-12T08:55:34.679968",
"content": "• **德明利(001309)** 现价632.35(+0.70%) 买入区585~647(近上沿) | 等回调至610~620区间再入场3%",
"report_id": "cron_d3797d924ddc_2026-06-11_16-45-41"
},
{
"time": "2026-06-15T08:55:17.014788",
"content": "- 德明利(001309) ¥617.43,买入区605.08~629.78 ✅ 在区间内,RR:3.51(高价股>300元/股,注意仓位)",
"report_id": "cron_e02b8bde74f8_2026-06-14_22-04-57"
},
{
"time": "2026-06-15T08:55:17.014788",
"content": "{\"type\":\"周复盘\",\"time\":\"周日\",\"summary\":\"A股先跌后弹分化格局,全市场普跌后暴力反弹\",\"key_holdings\":[{\"code\":\"600110\",\"name\":",
"report_id": "cron_e02b8bde74f8_2026-06-14_22-04-57"
},
{
"time": "2026-06-14T08:55:34.460610",
"content": "**🟢 德明利(001309) ¥617.43 | 买入区605.08~629.78 ✅ | RR:3.51**",
"report_id": "cron_watchlist_health_weekly_2026-06-13_20-07-41"
}
]
} }
+5
View File
@@ -56,6 +56,11 @@
"content": "**中芯国际(688981/00981)** — 科创/半导体板块资金巨量流入,A股+6.94%收151.53,港股放量218M。持有信号,科技主线延续。", "content": "**中芯国际(688981/00981)** — 科创/半导体板块资金巨量流入,A股+6.94%收151.53,港股放量218M。持有信号,科技主线延续。",
"report_id": "cron_99c06255590a_2026-06-25_08-33-37" "report_id": "cron_99c06255590a_2026-06-25_08-33-37"
}, },
{
"time": "2026-06-26T08:55:32.944422",
"content": "**中芯国际H(00981)** 现价86.0距TP87.26仅1.5%,接近止盈",
"report_id": "cron_99c06255590a_2026-06-26_08-43-03"
},
{ {
"time": "2026-06-02T12:55:54.836964", "time": "2026-06-02T12:55:54.836964",
"content": "• 中芯国际H(00981) ¥82.20 +3.46% — 高于买入区72-75", "content": "• 中芯国际H(00981) ¥82.20 +3.46% — 高于买入区72-75",
+15
View File
@@ -51,6 +51,16 @@
"content": "**丘钛科技(01478) 7.69 | 仓位10.48%** — 深套44%,消费电子持续疲弱,昨日继续-2.41%。10.48%仓位已是超配,若破7.5建议减至7%以内。", "content": "**丘钛科技(01478) 7.69 | 仓位10.48%** — 深套44%,消费电子持续疲弱,昨日继续-2.41%。10.48%仓位已是超配,若破7.5建议减至7%以内。",
"report_id": "cron_99c06255590a_2026-06-25_08-33-37" "report_id": "cron_99c06255590a_2026-06-25_08-33-37"
}, },
{
"time": "2026-06-26T08:55:32.944422",
"content": "| 01478 | 丘钛科技 | 7.20 | 13.77 | **-47.7%** | SL7.33 ❌BREACHED | 止损已破 |",
"report_id": "cron_99c06255590a_2026-06-26_08-43-03"
},
{
"time": "2026-06-26T08:55:32.944422",
"content": "**丘钛科技(01478)** 现价7.20(-4.1%) | 仓位6.37% | **已跌破止损7.33**,深套-47%但止损纪律必须执行",
"report_id": "cron_99c06255590a_2026-06-26_08-43-03"
},
{ {
"time": "2026-06-02T12:55:54.834592", "time": "2026-06-02T12:55:54.834592",
"content": "| 丘钛科技(01478) | 10.12 | -1.17% | 9.19% | 深套持有,止损9.0 |", "content": "| 丘钛科技(01478) | 10.12 | -1.17% | 9.19% | 深套持有,止损9.0 |",
@@ -421,6 +431,11 @@
"content": "**丘钛科技(01478)** 距止损-16.2%!现价6.67(-2.41%),弱支撑7.51已破。仓位10.48%为最大单仓。成本13.81(-51.7%)。操作:如跌破6.0需强制减半仓,下行缺", "content": "**丘钛科技(01478)** 距止损-16.2%!现价6.67(-2.41%),弱支撑7.51已破。仓位10.48%为最大单仓。成本13.81(-51.7%)。操作:如跌破6.0需强制减半仓,下行缺",
"report_id": "cron_d42f2ce3b479_2026-06-24_20-04-19" "report_id": "cron_d42f2ce3b479_2026-06-24_20-04-19"
}, },
{
"time": "2026-06-26T08:55:33.008635",
"content": "**丘钛科技(01478) 7.2(-6.37%) | 距止损-32%** 成本13.77浮亏-47.7%,放量破位弱势加剧。建议:深套不动,破6.5需重新评估。",
"report_id": "cron_d42f2ce3b479_2026-06-25_20-10-53"
},
{ {
"time": "2026-06-01T10:25:54.503460", "time": "2026-06-01T10:25:54.503460",
"content": "丘钛科技(01478) 仓位8.58% +4.10%→ 持有,走势健康", "content": "丘钛科技(01478) 仓位8.58% +4.10%→ 持有,走势健康",
+5
View File
@@ -636,6 +636,11 @@
"content": "**阿里巴巴(09988.HK) 现价109.3 | 距止损104.67仅-4.2%** 浮亏-13.66%仓位7.51%,持续走弱。弱支撑107.07已破,强支撑104.67即止损位。操作:浮亏>", "content": "**阿里巴巴(09988.HK) 现价109.3 | 距止损104.67仅-4.2%** 浮亏-13.66%仓位7.51%,持续走弱。弱支撑107.07已破,强支撑104.67即止损位。操作:浮亏>",
"report_id": "cron_d42f2ce3b479_2026-06-15_20-06-33" "report_id": "cron_d42f2ce3b479_2026-06-15_20-06-33"
}, },
{
"time": "2026-06-26T08:55:33.008635",
"content": "**阿里巴巴(09988) 95.0(-4.43%)** 跌破买入区92.8~96.5下沿,港股科技分化严重。建议:观望等站稳。",
"report_id": "cron_d42f2ce3b479_2026-06-25_20-10-53"
},
{ {
"time": "2026-06-22T08:55:38.754230", "time": "2026-06-22T08:55:38.754230",
"content": "| **阿里巴巴(09988)** | 成本$126.68,现价≈$107.3,浮亏-15.2%,止损$104.67距仅2.5% | 最危险持仓,需设条件单 |", "content": "| **阿里巴巴(09988)** | 成本$126.68,现价≈$107.3,浮亏-15.2%,止损$104.67距仅2.5% | 最危险持仓,需设条件单 |",
+5
View File
@@ -46,6 +46,11 @@
"content": "• 宁德时代(300750) 391.55 — 成本402回踩中,390不破持有", "content": "• 宁德时代(300750) 391.55 — 成本402回踩中,390不破持有",
"report_id": "cron_99c06255590a_2026-06-22_08-37-35" "report_id": "cron_99c06255590a_2026-06-22_08-37-35"
}, },
{
"time": "2026-06-26T08:55:32.944422",
"content": "**宁德时代(300750)** 现价401.90(持平) | 仓位3.72% | 昨日触发买入区间393~398,现价仍在成本附近,创业板指+1.46%支撑",
"report_id": "cron_99c06255590a_2026-06-26_08-43-03"
},
{ {
"time": "2026-06-02T12:55:54.834592", "time": "2026-06-02T12:55:54.834592",
"content": "| 宁德时代(300750) | 427.84 | +1.84% | 4.04% | 持有,止损400止盈460 |", "content": "| 宁德时代(300750) | 427.84 | +1.84% | 4.04% | 持有,止损400止盈460 |",
+10
View File
@@ -56,6 +56,11 @@
"content": "**紫金矿业(601899) 27.65 | 仓位8.19%** — 贵金属板块暴跌-8.6%、工业金属-5.53%,双杀!深套31%为第一大仓位,若本周破前低24.98需考虑减仓至5%控制风险。", "content": "**紫金矿业(601899) 27.65 | 仓位8.19%** — 贵金属板块暴跌-8.6%、工业金属-5.53%,双杀!深套31%为第一大仓位,若本周破前低24.98需考虑减仓至5%控制风险。",
"report_id": "cron_99c06255590a_2026-06-25_08-33-37" "report_id": "cron_99c06255590a_2026-06-25_08-33-37"
}, },
{
"time": "2026-06-26T08:55:32.944422",
"content": "**紫金矿业(601899)** — 贵金属板块两日累跌-8%,隔夜金价再跌-0.44%,距止损24.48仅5.6%空间",
"report_id": "cron_99c06255590a_2026-06-26_08-43-03"
},
{ {
"time": "2026-06-01T10:25:54.419132", "time": "2026-06-01T10:25:54.419132",
"content": "2. **紫金矿业(601899)** 进入加仓区间29-30,可考虑分批加仓", "content": "2. **紫金矿业(601899)** 进入加仓区间29-30,可考虑分批加仓",
@@ -551,6 +556,11 @@
"content": "4. **紫金矿业(601899)**:金铜价格走势,反弹至34+减仓窗口", "content": "4. **紫金矿业(601899)**:金铜价格走势,反弹至34+减仓窗口",
"report_id": "cron_d42f2ce3b479_2026-06-02_20-02-43" "report_id": "cron_d42f2ce3b479_2026-06-02_20-02-43"
}, },
{
"time": "2026-06-26T08:55:33.008635",
"content": "**紫金矿业(601899) 25.92(-6.26%) | 距止损-20.8%** 成本40.27浮亏-35.6%,资源板块连续重挫,贵金属/工业金属全线杀跌。建议:24.5设观察线,破则减半仓。",
"report_id": "cron_d42f2ce3b479_2026-06-25_20-10-53"
},
{ {
"time": "2026-06-22T08:55:38.754230", "time": "2026-06-22T08:55:38.754230",
"content": "| **紫金矿业(601899)** | 成本$40.27,止盈$34.47已低于成本,仓位6.98%第二大 | 策略可能需要重新评估——止盈低于成本价,逻辑错误 |", "content": "| **紫金矿业(601899)** | 成本$40.27,止盈$34.47已低于成本,仓位6.98%第二大 | 策略可能需要重新评估——止盈低于成本价,逻辑错误 |",
+97 -4
View File
@@ -1,7 +1,100 @@
{ {
"code": "603259", "code": "603259",
"name": "药明康德", "history": [
"status": "watchlist", {
"converted_at": "2026-06-25 13:21", "time": "2026-06-11T08:55:22.591626",
"note": "清仓转自选,价格参考: 药明康德@117.52 德明利@0" "content": "• 药明康德(603259) 97.04 → 持有,略高于买入区93.5~97.0上沿。止损90/止盈105。200股浮盈+0%。",
"report_id": "cron_99c06255590a_2026-06-11_08-45-23"
},
{
"time": "2026-06-11T08:55:22.591626",
"content": "{\"type\":\"盘前\",\"time\":\"08:43\",\"holdings\":[{\"code\":\"600110\",\"name\":\"诺德股份\",\"action\":\"持有\",\"trigger\":\"买入区1",
"report_id": "cron_99c06255590a_2026-06-11_08-45-23"
},
{
"time": "2026-06-15T08:55:17.001525",
"content": "• **药明康德(603259) ¥99.71** — 买入区96.57~98.23,现价略高",
"report_id": "cron_99c06255590a_2026-06-15_08-41-00"
},
{
"time": "2026-06-16T08:55:43.793441",
"content": "**药明康德(603259)** 96.95 持平 — 新仓成本95.26,止损90/止盈105,持有观察",
"report_id": "cron_99c06255590a_2026-06-16_08-38-28"
},
{
"time": "2026-06-17T08:55:49.338608",
"content": "药明康德(603259) ¥99.71 +0.41% | 买入区96.6~98.2,带下影阳线偏多",
"report_id": "cron_99c06255590a_2026-06-17_08-35-59"
},
{
"time": "2026-06-11T08:55:23.397094",
"content": "**药明康德(603259)** 97.04(+3.95%) → 新仓200股,策略买入区93.50~97.00,现价触及上沿。止损90/止盈105。持有观察,若回踩95可加仓。",
"report_id": "cron_d3797d924ddc_2026-06-10_15-56-34"
},
{
"time": "2026-06-11T08:55:23.397094",
"content": "{\"code\":\"603259\",\"name\":\"药明康德\",\"action\":\"持有\",\"price\":97.04},",
"report_id": "cron_d3797d924ddc_2026-06-10_15-56-34"
},
{
"time": "2026-06-11T08:55:23.385966",
"content": "• 药明康德(603259) 97.04(+3.81%) → 触及买入区上沿97.00,持有。止损90/止盈105,仓位1.89%",
"report_id": "cron_d3797d924ddc_2026-06-10_16-06-20"
},
{
"time": "2026-06-11T08:55:23.385966",
"content": "{\"type\":\"盯盘\",\"time\":\"16:01\",\"holdings\":[{\"code\":\"603259\",\"name\":\"药明康德\",\"action\":\"持有\",\"price\":97.04},",
"report_id": "cron_d3797d924ddc_2026-06-10_16-06-20"
},
{
"time": "2026-06-11T08:55:23.373283",
"content": "**药明康德(603259) 97.04(+3.81%)** → 新入持仓200股,现价在买入区93.50~97.00上沿。止损90.00/止盈105.00。浮盈+0.00%,仓位1.89%。建议持有",
"report_id": "cron_d3797d924ddc_2026-06-10_16-27-18"
},
{
"time": "2026-06-11T08:55:23.373283",
"content": "{\"type\":\"盯盘\",\"time\":\"16:16\",\"holdings\":[{\"code\":\"603259\",\"name\":\"药明康德\",\"action\":\"持有\",\"price\":97.04},",
"report_id": "cron_d3797d924ddc_2026-06-10_16-27-18"
},
{
"time": "2026-06-11T08:55:23.371021",
"content": "**药明康德(603259) 97.04(+3.81%) → 触及买入区上沿,可持有**",
"report_id": "cron_d3797d924ddc_2026-06-10_16-42-16"
},
{
"time": "2026-06-11T08:55:23.371021",
"content": "{\"type\":\"盯盘\",\"time\":\"16:30\",\"holdings\":[{\"code\":\"603259\",\"name\":\"药明康德\",\"action\":\"持有\",\"price\":97.04},",
"report_id": "cron_d3797d924ddc_2026-06-10_16-42-16"
},
{
"time": "2026-06-11T08:55:23.369272",
"content": "**药明康德(603259) 97.04(+3.81%)** → 新持仓首日,买入区93.50~97.00,现价97.04略超上沿(+0.04%),止损90.00/止盈105.00。持有观察",
"report_id": "cron_d3797d924ddc_2026-06-10_16-54-00"
},
{
"time": "2026-06-11T08:55:23.369272",
"content": "{\"type\":\"盯盘\",\"time\":\"16:45\",\"holdings\":[{\"code\":\"600110\",\"name\":\"诺德股份\",\"action\":\"持有\",\"price\":12.20},",
"report_id": "cron_d3797d924ddc_2026-06-10_16-54-00"
},
{
"time": "2026-06-16T08:55:43.812327",
"content": "**自选距买入区±3%内**:中芯国际A(688981) 现价130.52(买入区124.88~128.80,距上沿+1.3%);宁德时代(300750) 现价398.1(买入区391.71~399.",
"report_id": "cron_d42f2ce3b479_2026-06-15_20-06-33"
},
{
"time": "2026-06-20T08:55:13.499309",
"content": "**药明康德(603259) 102.72(+4.60%)** | 仓位4.02%→持有",
"report_id": "cron_d42f2ce3b479_2026-06-19_20-05-49"
},
{
"time": "2026-06-12T08:55:35.665176",
"content": "• **药明康德(603259)** ¥96.31 (-0.75%) — 买入区93.50~97.00内,距上沿-0.7%200股底仓浮盈+1.1%。止损90/止盈105,持有观察",
"report_id": "cron_e3bf7b13af8d_2026-06-11_09-32-24"
},
{
"time": "2026-06-12T08:55:35.665176",
"content": "{\"code\":\"603259\",\"name\":\"药明康德\",\"action\":\"持有\",\"price\":96.31,\"reason\":\"买入区内运行,距上沿-0.7%\"},",
"report_id": "cron_e3bf7b13af8d_2026-06-11_09-32-24"
}
]
} }
+5
View File
@@ -816,6 +816,11 @@
"content": "**海博思创(688411)** 现价264.66(+9.68%) | 仓6.98%→持有", "content": "**海博思创(688411)** 现价264.66(+9.68%) | 仓6.98%→持有",
"report_id": "cron_d42f2ce3b479_2026-06-12_20-09-22" "report_id": "cron_d42f2ce3b479_2026-06-12_20-09-22"
}, },
{
"time": "2026-06-26T08:55:33.008635",
"content": "**海博思创(688411) 275.89(+3.64%) | 仓位5.17%→若加仓~7.6%**",
"report_id": "cron_d42f2ce3b479_2026-06-25_20-10-53"
},
{ {
"time": "2026-06-08T08:55:37.165829", "time": "2026-06-08T08:55:37.165829",
"content": "2. **海博思创(688411) 追踪止盈失守未补救** — 高点305.53回落5%约290的追踪止盈被击穿(6/4 收274.90),但未在285~290反弹位减仓,浮盈从+24.76%缩窄至+", "content": "2. **海博思创(688411) 追踪止盈失守未补救** — 高点305.53回落5%约290的追踪止盈被击穿(6/4 收274.90),但未在285~290反弹位减仓,浮盈从+24.76%缩窄至+",
+5
View File
@@ -26,6 +26,11 @@
"content": "**华恒生物(688639) 21.4 | 仓位7.42%** — 光头光脚阴线形态偏空,在买入区21.06~21.54下沿,若破21.0减仓1/3。", "content": "**华恒生物(688639) 21.4 | 仓位7.42%** — 光头光脚阴线形态偏空,在买入区21.06~21.54下沿,若破21.0减仓1/3。",
"report_id": "cron_99c06255590a_2026-06-25_08-33-37" "report_id": "cron_99c06255590a_2026-06-25_08-33-37"
}, },
{
"time": "2026-06-26T08:55:32.944422",
"content": "**华恒生物(688639)** — 已跌破止损20.03(现价17.12),昨日同花顺向下突破预警,-20%浮亏,需止损",
"report_id": "cron_99c06255590a_2026-06-26_08-43-03"
},
{ {
"time": "2026-06-01T14:55:20.378304", "time": "2026-06-01T14:55:20.378304",
"content": "• 华恒生物(688639) 23.58 | +0.47% → 🤝持有,接近止损23.18", "content": "• 华恒生物(688639) 23.58 | +0.47% → 🤝持有,接近止损23.18",
+152 -124
View File
@@ -1,245 +1,273 @@
{ {
"checked_at": "2026-06-25T11:35:00", "checked_at": "2026-06-26T10:42:17",
"total_active": 52, "total_active": 38,
"flagged_count": 15, "flagged_count": 17,
"flagged": [ "flagged": [
{ {
"code": "000657", "code": "000657",
"name": "\u4e2d\u94a8\u9ad8\u65b0", "name": "中钨高新",
"price": 100.08, "price": 106.49,
"flags": [ "flags": [
"\u73b0\u4ef7100.08\u5728\u4e70\u5165\u533a98~102\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价106.49在买入区104~108(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:44", "last_update": "2026-06-26 10:40",
"entry_zone": "98~102", "entry_zone": "104~108",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u6807112.75 | \u6b62\u635f95.93 | \u4e70\u5165\u533a98.08~102.08", "current": "盈利持有 | 目标116.25 | 止损103.12 | 买入区104.36~108.37",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "000711", "code": "000711",
"name": "ST\u4eac\u84dd", "name": "ST京蓝",
"price": 5.04, "price": 4.55,
"flags": [ "flags": [
"\u73b0\u4ef75.04\u5728\u4e70\u5165\u533a5~5\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价4.55在买入区4~5(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:44", "last_update": "2026-06-26 10:40",
"entry_zone": "5~5", "entry_zone": "4~5",
"current": "\u76c8\u5229\u6301\u6709 | \u26a0\ufe0f\u76c8\u4e8f\u6bd4\u504f\u4f4e(1:1.8)\uff0c\u8c28\u614e\u4e70\u5165 | \u76ee\u68075.38 | \u6b62\u635f4.33 | \u4e70\u5165\u533a4.94~5.06 | \u4fe1\u53f7:\u89c2\u671b", "current": "盈利持有 | 目标5.03 | 止损3.94 | 买入区4.46~4.64 | 信号:观望",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "001309",
"name": "德明利",
"price": 908.72,
"flags": [
"现价908.72在买入区873~909(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-06-26 10:40",
"entry_zone": "873~909",
"current": "盈利持有 | 止损参考810.0 | 买入区873.18~908.82",
"updated_by": "manual",
"updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "002594", "code": "002594",
"name": "\u6bd4\u4e9a\u8fea", "name": "比亚迪",
"price": 83.3, "price": 79.39,
"flags": [ "flags": [
"\u73b0\u4ef783.30\u5728\u4e70\u5165\u533a82~85\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价79.39在买入区78~81(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:44", "last_update": "2026-06-26 10:40",
"entry_zone": "82~85", "entry_zone": "78~81",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u680792.71 | \u6b62\u635f75.24 | \u4e70\u5165\u533a81.63~84.97 | \u4fe1\u53f7:\u89c2\u671b", "current": "盈利持有 | 目标90.42 | 止损74.7 | 买入区77.8~80.98 | 信号:观望",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "00968", "code": "00968",
"name": "\u4fe1\u4e49\u5149\u80fd", "name": "信义光能",
"price": 2.0, "price": 2.02,
"flags": [ "flags": [
"\u73b0\u4ef72.00\u5728\u4e70\u5165\u533a2~2\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价2.02在买入区2~2(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:44", "last_update": "2026-06-26 10:40",
"entry_zone": "2~2", "entry_zone": "2~2",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u68072.58 | \u6b62\u635f1.8 | \u4e70\u5165\u533a1.96~2.04", "current": "盈利持有 | 目标2.61 | 止损1.71 | 买入区1.98~2.06",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "01070", "code": "01070",
"name": "TCL\u7535\u5b50", "name": "TCL电子",
"price": 13.1, "price": 12.49,
"flags": [ "flags": [
"[STRATEGY_STALE] \u4fe1\u53f7\u4e0d\u826f(timing_signal\u542b['\u5f31\u52bf\u6301\u6709'])", "现价12.49在买入区12~13(是否可买需结合timing_signal判断)"
"\u73b0\u4ef713.10\u5728\u4e70\u5165\u533a13~13\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:44", "last_update": "2026-06-26 10:40",
"entry_zone": "13~13", "entry_zone": "12~13",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u680715.51 | \u6b62\u635f12.29 | \u4e70\u5165\u533a12.84~13.36 | \u4fe1\u53f7:\u5f31\u52bf\u6301\u6709", "current": "盈利持有 | 目标15.31 | 止损11.2 | 买入区12.24~12.74 | 信号:关注",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "02318",
"name": "中国平安",
"price": 50.65,
"flags": [
"现价50.65在买入区51~53(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-06-26 10:41",
"entry_zone": "51~53",
"current": "盈利持有 | 止损参考50.05 | 买入区50.57~52.63 | 信号:关注",
"updated_by": "manual",
"updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "02359", "code": "02359",
"name": "\u836f\u660e\u5eb7\u5fb7", "name": "药明康德",
"price": 141.7, "price": 146.0,
"flags": [ "flags": [
"\u73b0\u4ef7141.70\u5728\u4e70\u5165\u533a139~144\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价146.00在买入区143~149(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "139~144", "entry_zone": "143~149",
"current": "\u76c8\u5229\u6301\u6709 | \u26a0\ufe0f\u76c8\u4e8f\u6bd4\u504f\u4f4e(1:2.0)\uff0c\u8c28\u614e\u4e70\u5165 | \u76ee\u6807163.23 | \u6b62\u635f126.88 | \u4e70\u5165\u533a138.87~143.77 | \u4fe1\u53f7:\u4e70\u5165", "current": "盈利持有 | 目标176.4 | 止损125.09 | 买入区143.08~148.92 | 信号:关注",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "02628", "code": "02628",
"name": "\u4e2d\u56fd\u4eba\u5bff", "name": "中国人寿",
"price": 28.32, "price": 27.54,
"flags": [ "flags": [
"\u73b0\u4ef728.32\u5728\u4e70\u5165\u533a28~29\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价27.54在买入区27~28(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "28~29", "entry_zone": "27~28",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u680732.72 | \u6b62\u635f25.58 | \u4e70\u5165\u533a27.75~28.89", "current": "盈利持有 | 目标31.98 | 止损23.71 | 买入区26.99~28.09 | 信号:关注",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "06160", "code": "06160",
"name": "\u767e\u6d4e\u795e\u5dde", "name": "百济神州",
"price": 165.2, "price": 167.3,
"flags": [ "flags": [
"\u73b0\u4ef7165.20\u5728\u4e70\u5165\u533a162~168\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价167.30在买入区164~169(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "162~168", "entry_zone": "164~169",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u6807180.64 | \u6b62\u635f149.22 | \u4e70\u5165\u533a161.9~168.4", "current": "盈利持有 | 目标184.03 | 止损154.72 | 买入区163.95~169.32 | 信号:关注",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "09988", "code": "09988",
"name": "\u963f\u91cc\u5df4\u5df4-W", "name": "阿里巴巴-W",
"price": 99.4, "price": 90.65,
"flags": [ "flags": [
"\u73b0\u4ef799.40\u5728\u4e70\u5165\u533a97~101\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价90.65在买入区89~92(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "97~101", "entry_zone": "89~92",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u6807115.07 | \u6b62\u635f89.79 | \u4e70\u5165\u533a97.41~101.39 | \u4fe1\u53f7:\u5173\u6ce8", "current": "盈利持有 | 目标114.0 | 止损76.7 | 买入区88.84~92.46 | 信号:关注",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "300124", "code": "300124",
"name": "\u6c47\u5ddd\u6280\u672f", "name": "汇川技术",
"price": 66.31, "price": 64.28,
"flags": [ "flags": [
"\u73b0\u4ef766.31\u5728\u4e70\u5165\u533a65~68\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价64.28在买入区63~66(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "65~68", "entry_zone": "63~66",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u680773.13 | \u6b62\u635f62.39 | \u4e70\u5165\u533a64.98~67.64 | \u4fe1\u53f7:\u89c2\u671b", "current": "盈利持有 | 目标73.21 | 止损60.48 | 买入区62.99~65.57 | 信号:观望",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "300308",
"name": "\u4e2d\u9645\u65ed\u521b",
"price": 1312.18,
"flags": [
"\u73b0\u4ef71312.18\u5728\u4e70\u5165\u533a1286~1338\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09"
],
"age_days": 0,
"last_update": "2026-06-24 16:45",
"entry_zone": "1286~1338",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u68071447.8 | \u6b62\u635f1272.81 | \u4e70\u5165\u533a1285.94~1338.42",
"updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "600519", "code": "600519",
"name": "\u8d35\u5dde\u8305\u53f0", "name": "贵州茅台",
"price": 1207.68, "price": 1177.91,
"flags": [ "flags": [
"\u73b0\u4ef71207.68\u5728\u4e70\u5165\u533a1184~1231\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价1177.91在买入区1154~1197(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "1184~1231", "entry_zone": "1154~1197",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u68071320.83 | \u6b62\u635f1171.45 | \u4e70\u5165\u533a1183.53~1231.2 | \u4fe1\u53f7:\u5173\u6ce8", "current": "盈利持有 | 目标1279.04 | 止损1142.57 | 买入区1154.35~1197.16 | 信号:关注",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "601318", "code": "601318",
"name": "\u4e2d\u56fd\u5e73\u5b89", "name": "中国平安",
"price": 49.12, "price": 47.69,
"flags": [ "flags": [
"\u73b0\u4ef749.12\u5728\u4e70\u5165\u533a48~50\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价47.69在买入区47~49(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "48~50", "entry_zone": "47~49",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u680753.61 | \u6b62\u635f47.65 | \u4e70\u5165\u533a48.14~50.03 | \u4fe1\u53f7:\u89c2\u671b", "current": "盈利持有 | 目标53.07 | 止损46.26 | 买入区46.74~48.64 | 信号:观望",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true
},
{
"code": "688630",
"name": "芯碁微装",
"price": 531.54,
"flags": [
"现价531.54在买入区521~542(是否可买需结合timing_signal判断)"
],
"age_days": 0,
"last_update": "2026-06-26 10:41",
"entry_zone": "521~542",
"current": "盈利持有 | 目标645.42 | 止损463.35 | 买入区520.91~542.17",
"updated_by": "auto",
"updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "688795", "code": "688795",
"name": "\u6469\u5c14\u7ebf\u7a0b-U", "name": "摩尔线程-U",
"price": 704.8, "price": 674.0,
"flags": [ "flags": [
"\u73b0\u4ef7704.80\u5728\u4e70\u5165\u533a691~719\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价674.00在买入区661~687(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "691~719", "entry_zone": "661~687",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u6807831.78 | \u6b62\u635f683.66 | \u4e70\u5165\u533a690.7~718.9 | \u4fe1\u53f7:\u89c2\u671b", "current": "盈利持有 | 目标815.28 | 止损634.17 | 买入区660.52~687.48 | 信号:观望",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
}, },
{ {
"code": "688802", "code": "688802",
"name": "\u6c90\u66e6\u80a1\u4efd-U", "name": "沐曦股份-U",
"price": 770.19, "price": 741.92,
"flags": [ "flags": [
"\u73b0\u4ef7770.19\u5728\u4e70\u5165\u533a755~786\uff08\u662f\u5426\u53ef\u4e70\u9700\u7ed3\u5408timing_signal\u5224\u65ad\uff09" "现价741.92在买入区727~757(是否可买需结合timing_signal判断)"
], ],
"age_days": 0, "age_days": 0,
"last_update": "2026-06-24 16:45", "last_update": "2026-06-26 10:41",
"entry_zone": "755~786", "entry_zone": "727~757",
"current": "\u76c8\u5229\u6301\u6709 | \u76ee\u6807882.43 | \u6b62\u635f747.08 | \u4e70\u5165\u533a754.79~785.59", "current": "盈利持有 | 目标870.66 | 止损698.07 | 买入区727.08~756.76",
"updated_by": "auto", "updated_by": "auto",
"updated_reason": "\u81ea\u52a8\u751f\u6210", "updated_reason": "自动生成",
"is_watchlist": true "is_watchlist": true
} }
], ],
"portfolio": { "portfolio": {
"total_assets": 1212445.58, "position_pct": 93.5,
"cash": 150624.58, "cash": 69825,
"position_pct": 87.6, "weak_position_pct": 50.0,
"weak_position_pct": 47.8, "all_weak_pct": 52.6,
"all_weak_pct": 47.8,
"signals": [ "signals": [
"[PORTFOLIO_WEAK] \u7ec4\u5408\u5f31\u52bf\u5360\u6bd448%>40%\uff0c\u5efa\u8bae\u7cfb\u7edf\u6027\u51cf\u4ed3", "[PORTFOLIO_WEAK] 组合中弱势+深套分类持仓占比50.0%>40%,建议系统性减仓",
"[PORTFOLIO_FULL] \u603b\u4ed3\u4f4d87.6%\uff08\u73b0\u91d1150625\u5143\uff09\uff0c\u4e70\u5165\u5efa\u8bae\u53d7\u9650" "[PORTFOLIO_FULL] 总仓位93.5%(现金69825元),买入建议受限"
] ]
}, },
"summary": "\u626b\u63cf52\u4e2a\u7b56\u7565\uff0c15\u4e2a\u9700\u5173\u6ce8" "summary": "扫描38个策略,17个需关注"
} }
+199 -66
View File
@@ -1,85 +1,218 @@
{ {
"timestamp": "2026-06-25 16:00", "timestamp": "2026-06-26 16:07",
"analyses": [ "analyses": [
{ {
"name": "法拉电子", "name": "紫金矿业",
"code": "600563", "code": "601899",
"sentiment": "positive", "price": 25.1,
"confidence": 0.82, "sentiment": "negative",
"brief": "元器件板块大涨3.14%,法拉电子领涨6.31%", "confidence": 0.59,
"keywords": ["元器件", "板块领涨", "电容器"] "brief": "紫金矿业成交额超上一日全天。数据宝统计,截至14:10,紫金矿业成交额116.5...",
"keywords": [
"易控智驾通过港交所聆讯",
"紫金矿业",
"宁德时代",
"郑州高新基金参投",
"紫金矿业成交额超上一日全天"
],
"news_count": 5,
"pos_count": 0,
"neg_count": 2,
"neu_count": 3,
"reason": "SL_dist=19.6% TP_dist=3.3%",
"priority": 1
}, },
{ {
"name": "中芯国际", "name": "中银香港",
"code": "688981", "code": "02388",
"sentiment": "positive", "price": 45.48,
"confidence": 0.75, "sentiment": "neutral",
"brief": "半导体板块涨2.21%,中芯国际涨3.52%跟随", "confidence": 0.56,
"keywords": ["半导体", "中芯国际", "科创板"] "brief": "中银香港携泰国子行首批接入人民银行“数币达”平台。中银香港副总裁邢桂伟表示:“中...",
"keywords": [
"中银香港携泰国子行首批接入人民银行",
"数币达",
"平台",
"中银香港副总裁邢桂伟表示",
"中银香港陈卫全"
],
"news_count": 5,
"pos_count": 1,
"neg_count": 0,
"neu_count": 4,
"reason": "SL_dist=10.6% TP_dist=0.3%",
"priority": 1
}, },
{ {
"name": "宁德时代", "name": "宁德时代",
"code": "300750", "code": "300750",
"sentiment": "neutral", "price": 381.0,
"confidence": 0.60,
"brief": "宁德时代微涨1.65%,接近止盈位420.51",
"keywords": ["宁德时代", "新能源", "止盈"]
},
{
"name": "黄金ETF华安",
"code": "518880",
"sentiment": "negative", "sentiment": "negative",
"confidence": 0.78, "confidence": 0.6,
"brief": "贵金属板块大跌4.2%拖累黄金ETF跌2.68%", "brief": "宁德时代成交额超150亿元。数据宝统计,截至14:16,宁德时代成交额151.1...",
"keywords": ["贵金属", "黄金", "ETF"] "keywords": [
"股宁德时代盘中跌",
"现报",
"宁德时代成交额超",
"亿元",
"数据宝统计"
],
"news_count": 5,
"pos_count": 1,
"neg_count": 2,
"neu_count": 2,
"reason": "SL_dist=13.4% TP_dist=3.9%",
"priority": 1
}, },
{ {
"name": "建滔积层板", "name": "腾讯控股",
"code": "01888", "code": "00700",
"price": 411.8,
"sentiment": "positive", "sentiment": "positive",
"confidence": 0.88, "confidence": 0.56,
"brief": "元件板块强势,建滔积层板大涨11.38%", "brief": "100家港股公司回购腾讯控股回购5.01亿港元。本次回购5.01亿港元的腾讯控股...",
"keywords": ["覆铜板", "元件", "大涨"] "keywords": [
}, "家港股公司回购腾讯控股回购",
{ "亿港元",
"name": "长飞光纤光缆", "本次回购",
"code": "06869", "亿港元的腾讯控股",
"sentiment": "positive", "腾讯控股午后涨超"
"confidence": 0.85, ],
"brief": "光纤光缆需求旺盛,长飞大涨10.11%", "news_count": 5,
"keywords": ["光纤光缆", "通信", "大涨"] "pos_count": 2,
}, "neg_count": 0,
{ "neu_count": 3,
"name": "丘钛科技", "reason": "SL_dist=19.8% TP_dist=0.8%",
"code": "01478", "priority": 1
"sentiment": "negative",
"confidence": 0.80,
"brief": "光学光电子板块弱势,丘钛科技大跌6.37%",
"keywords": ["手机产业链", "光学", "大跌"]
},
{
"name": "紫金矿业",
"code": "601899",
"sentiment": "negative",
"confidence": 0.85,
"brief": "贵金属板块领跌4.2%,紫金矿业大跌6.26%",
"keywords": ["黄金", "紫金矿业", "贵金属"]
},
{
"name": "中科电气",
"code": "300035",
"sentiment": "negative",
"confidence": 0.75,
"brief": "小金属板块微跌,中科电气大跌5.91%",
"keywords": ["石墨电极", "小金属", "大跌"]
}, },
{ {
"name": "模塑科技", "name": "模塑科技",
"code": "000700", "code": "000700",
"price": 14.13,
"sentiment": "negative", "sentiment": "negative",
"confidence": 0.78, "confidence": 0.57,
"brief": "跌破止损位13.91,汽车零部件板块走弱", "brief": "模塑科技:基于商业保密要求,公司不便透露与客户的具体合作信息。证券日报网讯6月1...",
"keywords": ["止损", "汽车零部件", "下跌"] "keywords": [
"机器人概念逆势拉升模塑科技",
"祥鑫科技双双涨停",
"机器人概念盘中逆势拉升",
"模塑科技涨停",
"模塑科技"
],
"news_count": 5,
"pos_count": 1,
"neg_count": 2,
"neu_count": 2,
"reason": "SL_dist=1.6% TP_dist=20.3%",
"priority": 1
},
{
"name": "法拉电子",
"code": "600563",
"price": 188.76,
"sentiment": "neutral",
"confidence": 0.55,
"brief": "法拉电子:2025年年度权益分派实施公告。证券日报网讯6月4日,法拉电子发布20...",
"keywords": [
"法拉电子",
"年年度权益分派实施公告",
"证券日报网讯",
"法拉电子发布",
"三季度订单充足生产处于满产状态"
],
"news_count": 5,
"pos_count": 0,
"neg_count": 0,
"neu_count": 5,
"reason": "SL_dist=9.7% TP_dist=1.0%",
"priority": 1
},
{
"name": "中国神华",
"code": "01088",
"price": 40.6,
"sentiment": "positive",
"confidence": 0.56,
"brief": "中国神华:5月商品煤产量同比下降4.1%。南财智讯6月17日电,中国神华公告,5...",
"keywords": [
"中国神华",
"向财务公司增资",
"亿元",
"公告称",
"国家能源集团财务公司股东中国神华参与公司增资获董事会批准公司增资合计"
],
"news_count": 5,
"pos_count": 2,
"neg_count": 0,
"neu_count": 3,
"reason": "SL_dist=18.5% TP_dist=1.7%",
"priority": 1
},
{
"name": "中际旭创",
"code": "300308",
"price": 1253.89,
"sentiment": "negative",
"confidence": 0.62,
"brief": "中际旭创成交额超100亿元。数据宝统计,截至09:48,中际旭创成交额102.3...",
"keywords": [
"中际旭创成交额超",
"亿元",
"数据宝统计",
"截至",
"中际旭创成交额达"
],
"news_count": 5,
"pos_count": 0,
"neg_count": 4,
"neu_count": 1,
"reason": "涨跌幅-5.25%",
"priority": 2
},
{
"name": "长飞光纤光缆",
"code": "06869",
"price": 250.6,
"sentiment": "negative",
"confidence": 0.58,
"brief": "港股光通信股走弱长飞光纤光缆跌超8%。截至发稿,长飞光纤光缆(06869.HK)...",
"keywords": [
"港股光通信股走弱长飞光纤光缆跌超",
"截至发稿",
"长飞光纤光缆",
"舜宇光学科技",
"港股人工智能股震荡走低长飞光纤光缆跌超"
],
"news_count": 5,
"pos_count": 0,
"neg_count": 5,
"neu_count": 0,
"reason": "涨跌幅-12.87%",
"priority": 2
},
{
"name": "丘钛科技",
"code": "01478",
"price": 6.84,
"sentiment": "positive",
"confidence": 0.57,
"brief": "丘钛科技5月手机摄像头模组销售数量增长39.4%。丘钛科技5月手机摄像头模组销售...",
"keywords": [
"丘钛科技",
"月手机摄像头模组销售数量增长",
"月摄像头模组与激光雷达销量同比增",
"发布公告",
"公司摄像头模组与激光雷达销售数量合计"
],
"news_count": 5,
"pos_count": 3,
"neg_count": 0,
"neu_count": 2,
"reason": "涨跌幅-5.00%",
"priority": 2
} }
] ],
} "status": "ok",
"total_analyzed": 10,
"total_candidates": 10
}
+2 -2
View File
@@ -294,7 +294,7 @@ def save_cooldown(cd):
def in_cooldown(code, action_type, cooldown_dict, minutes=30): def in_cooldown(code, action_type, cooldown_dict, minutes=30):
key = f"{code}_{action_type}" key = f"{code}_{action_type}"
last = cooldown_dict.get(key, 0) last = cooldown_dict.get(key, 0)
elapsed = time.time() - last elapsed = datetime.now().timestamp() - last
return elapsed < minutes * 60, elapsed, key return elapsed < minutes * 60, elapsed, key
@@ -322,7 +322,7 @@ def main():
# 加载冷却状态 # 加载冷却状态
cooldown = load_cooldown() cooldown = load_cooldown()
now_ts = time.time() now_ts = datetime.now().timestamp()
# 读 decisions.json 获取完整策略数据 # 读 decisions.json 获取完整策略数据
code_data = {} code_data = {}
+403
View File
@@ -0,0 +1,403 @@
#!/usr/bin/env python3
"""XMPP Bot - 统一版,支持 --agent mohe|zhiwei|xiao 参数"""
import asyncio, logging, ssl, json, urllib.request, os, time, sys, re
from slixmpp import ClientXMPP
# ── Agent 配置 ──────────────────────────────────────────────
AGENTS = {
"mohe": {
"jid": "mohe@yoin.fun",
"password": "hermes123",
"nick": "mohe",
"name_cn": "莫荷",
"http_port": 5802,
"gateway": "http://localhost:8642/v1/chat/completions",
"session_id": "xmpp-mohe-v2",
"kanban_session_id": "xmpp-mohe-kanban",
"mention": "@mohe/@莫荷",
},
"zhiwei": {
"jid": "zhiwei@yoin.fun",
"password": "hermes123",
"nick": "zhiwei",
"name_cn": "知微",
"http_port": 5805,
"gateway": "http://localhost:8643/v1/chat/completions",
"session_id": "xmpp-zhiwei-v2",
"kanban_session_id": "xmpp-zhiwei-kanban",
"mention": "@zhiwei/@知微",
},
"xiaoguo": {
"jid": "xiaoguo@yoin.fun",
"password": "hermes123",
"nick": "xiaoguo",
"name_cn": "小果",
"http_port": 5806,
"gateway": "http://localhost:8645/v1/chat/completions",
"session_id": "xmpp-xiaoguo",
"kanban_session_id": "xmpp-xiaoguo-kanban",
"mention": "@xiaoguo/@小果",
},
}
agent = sys.argv[sys.argv.index("--agent") + 1] if "--agent" in sys.argv else "mohe"
cfg = AGENTS.get(agent, AGENTS["mohe"])
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s')
GATEWAY = cfg["gateway"]
API_KEY = "hermes123"
AGENT_NICK = cfg["nick"]
AGENT_NAME = cfg["name_cn"]
AGENT_JID = cfg["jid"]
AGENT_MENTION = cfg["mention"]
SESSION_ID = cfg["session_id"]
KANBAN_SESSION_ID = cfg.get("kanban_session_id", SESSION_ID)
HTTP_PORT = cfg["http_port"]
_opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
# ── 持久化消息队列(入站+出站) ──
# 入站:Dad发的消息,先入队再处理,处理失败不丢失
_inbound_queue = asyncio.Queue()
# 出站:外部脚本通过HTTP桥提交的待发送消息
_outbound_queue = []
# ── HTTP 桥(接收本地脚本的主动发送请求) ──
from http.server import HTTPServer, BaseHTTPRequestHandler
import threading, json as json_mod
_xmpp_resource = "mohe"
class SendHandler(BaseHTTPRequestHandler):
def do_POST(self):
length = int(self.headers.get('Content-Length', 0))
body = self.rfile.read(length)
try:
data = json_mod.loads(body)
target = data.get('to', 'hmo@yoin.fun')
text = data.get('body', '')
msg_type = data.get('type', 'chat')
if text:
if msg_type == 'groupchat':
from xml.sax.saxutils import escape
import subprocess as sp
safe = escape(text)
stanza = (
f"<message to='{target}' type='groupchat' xml:lang='en'>"
f"<body>{safe}</body></message>"
)
sp.run([
"docker", "exec", "ejabberd", "ejabberdctl",
"send_stanza_c2s", AGENT_NICK, "yoin.fun",
_xmpp_resource, stanza
], capture_output=True, timeout=10)
else:
_outbound_queue.append((target, text, msg_type))
self.send_response(200)
self.end_headers()
self.wfile.write(b'{"ok":true}')
else:
self.send_response(400)
self.end_headers()
self.wfile.write(b'{"ok":false,"error":"empty body"}')
except Exception as e:
self.send_response(500)
self.end_headers()
self.wfile.write(f'{{"ok":false,"error":"{e}"}}'.encode())
def _run_http():
server = HTTPServer(('127.0.0.1', HTTP_PORT), SendHandler)
server.timeout = 1.0
while True:
try:
server.handle_request()
except:
pass
threading.Thread(target=_run_http, daemon=True).start()
logging.info(f"🚀 {AGENT_NAME} HTTP 桥启动于 :{HTTP_PORT}")
# ── Agent Bot ───────────────────────────────────────────────
class AgentBot(ClientXMPP):
def __init__(self):
super().__init__(AGENT_JID, cfg["password"])
self.ready = asyncio.Event()
self._call_seq = 0
self._recent_sent = []
self._muc_joined = False
global _xmpp_resource
self.add_event_handler('session_bind', self.on_bind)
self.add_event_handler('session_start', self.on_session_start)
self.add_event_handler('message', self.on_msg)
self.add_event_handler('disconnected', self.on_disconnect)
self.add_event_handler('connected', self.on_connected)
def on_connected(self, event):
self.ready.clear()
def on_bind(self, event):
global _xmpp_resource
bound_jid = str(self.boundjid)
if "/" in bound_jid:
_xmpp_resource = bound_jid.split("/", 1)[1]
logging.info(f"XMPP resource captured: {_xmpp_resource}")
logging.info(f"JID set to: {bound_jid}")
async def on_session_start(self, event):
self.send_presence() # 发送上线presence,否则收不到私聊消息
self.plugin['xep_0045'].join_muc('coregroup@conference.yoin.fun', AGENT_NICK)
logging.info(f"{AGENT_NAME} 加入群聊 coregroup")
self.ready.set()
def on_disconnect(self, event):
self._muc_joined = False
# ── 入站消息:先入队,异步处理 ──
def on_msg(self, msg):
if msg['type'] in ('chat', 'groupchat'):
body = str(msg['body']).strip()
if not body:
return
sender = str(msg['from'])
msg_type = msg['type']
# 防回声
for s in self._recent_sent:
if body[:50] in s or s in body[:50]:
return
# 群聊过滤
if msg_type == 'groupchat':
nick = sender.split('/')[-1] if '/' in sender else ''
if nick == AGENT_NICK:
return
mention_list = AGENT_MENTION.replace('@', '').split('/')
is_for_me = any(m in body for m in ['@' + m for m in mention_list] + mention_list)
if not is_for_me:
return
logging.info(f"💬 群聊(#{self._call_seq}): {body[:60]}")
else:
logging.info(f"📩 老爸(#{self._call_seq}): {body[:60]}")
self._call_seq += 1
# 入队,不直接调gateway
_inbound_queue.put_nowait({
"seq": self._call_seq,
"content": body,
"sender": sender,
"is_group": (msg_type == 'groupchat'),
"session_id": SESSION_ID,
"ts": time.time(),
"bot_ref": self, # 保留bot引用用于回复
})
async def call_hermes(self, content, sender, is_group=False, seq=None, session_id=None):
"""调gateway处理消息,返回回复文本"""
msg_type = 'groupchat' if is_group else 'chat'
sid = session_id or SESSION_ID
try:
payload = json.dumps({
"model": "hermes-agent",
"messages": [{"role": "user", "content": content}]
}).encode()
req = urllib.request.Request(GATEWAY, data=payload, method="POST")
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", f"Bearer {API_KEY}")
req.add_header("X-Hermes-Session-Id", sid)
loop = asyncio.get_event_loop()
result = await loop.run_in_executor(None, lambda: _opener.open(req, timeout=600))
data = json.loads(result.read())
reply = data.get("choices", [{}])[0].get("message", {}).get("content", "")
return reply.strip()
except Exception as e:
logging.error(f"{AGENT_NAME} gateway调用失败: {e}")
return None
def send_reply(self, sender, reply, msg_type):
"""通过bot发送回复"""
if not reply:
return
if reply.startswith('__SILENT__') or '__SILENT__' in reply:
logging.info(f"⏭️ {AGENT_NAME} 沉默,不发送")
return
for phrase in ['我沉默', '我不说', '不说了', '不回复', '不插嘴', '我闭嘴']:
if phrase in reply:
logging.info(f"⏭️ {AGENT_NAME} 宣布沉默,拦截")
return
if msg_type == 'groupchat':
self.send_message(mto=sender, mbody=reply, mtype='groupchat')
else:
# 私聊回复:发到Dad发消息时的具体resource,确保同一客户端收到
# 不用裸JID(避免ejabberd路由到处于stream management pending的旧会话)
self.send_message(mto=sender, mbody=reply, mtype='chat')
# 备用也发裸JID(兼容resource可能变化的情况)
bare_jid = sender.split('/')[0] if '/' in sender else sender
import subprocess as sp
from xml.sax.saxutils import escape
safe = escape(reply)
sp.run([
"docker", "exec", "ejabberd", "ejabberdctl", "send_stanza",
AGENT_JID, bare_jid,
f"<message from='{AGENT_JID}' to='{bare_jid}' type='chat' xml:lang='en'><body>{safe}</body></message>"
], capture_output=True, timeout=10)
sent_norm = reply[:100]
self._recent_sent.append(sent_norm)
if len(self._recent_sent) > 10:
self._recent_sent.pop(0)
logging.info(f"{AGENT_NAME} 回复: {reply[:80]}")
# ── 入站消息处理循环(独立任务,崩了自动重启) ──
async def process_inbound():
"""从队列消费入站消息,调gateway处理,发回响应。
崩了会自动重启,不会丢消息(队列中的消息会等待下一轮处理)。"""
pending_tasks = set()
while True:
try:
item = await _inbound_queue.get()
bot = item["bot_ref"]
# 创建处理任务,保留引用防止GC
task = asyncio.create_task(handle_one(item, bot))
pending_tasks.add(task)
task.add_done_callback(pending_tasks.discard)
except asyncio.CancelledError:
break
except Exception as e:
logging.error(f"❌ 入站处理循环异常(已恢复): {e}")
await asyncio.sleep(1)
continue
async def handle_one(item, bot):
"""处理单条入站消息"""
try:
reply = await bot.call_hermes(
item["content"], item["sender"],
is_group=item["is_group"],
seq=item["seq"], session_id=item["session_id"]
)
if reply:
if seq := item.get("seq"):
if seq < bot._call_seq - 5:
return # 太旧的消息,跳过
msg_type = 'groupchat' if item["is_group"] else 'chat'
bot.send_reply(item["sender"], reply, msg_type)
else:
logging.warning(f"⚠️ 消息#{item['seq']} gateway返回空,保留在队列")
# 放回队尾等重试(最多3次)
retry_count = item.get("retry", 0)
if retry_count < 3:
item["retry"] = retry_count + 1
item["ts"] = time.time()
_inbound_queue.put_nowait(item)
except Exception as e:
logging.error(f"❌ 处理消息#{item.get('seq','?')}异常: {e}")
# ── 出站消息发送循环 ──
async def drain_outbound(bot):
"""从_outbound_queue取消息发送。独立循环,崩了自动重启。"""
while True:
try:
await asyncio.sleep(0.5)
while _outbound_queue:
target, text, msg_type = _outbound_queue.pop(0)
try:
bot.send_message(mto=target, mbody=text, mtype=msg_type)
sent_norm = text.strip()[:100]
bot._recent_sent.append(sent_norm)
if len(bot._recent_sent) > 10:
bot._recent_sent.pop(0)
logging.info(f"📤 主动发送到 {target}: {text[:60]}")
except Exception as e:
logging.error(f"❌ 主动发送失败: {e}")
_outbound_queue.insert(0, (target, text, msg_type)) # 放回队首重试
await asyncio.sleep(3)
break
except asyncio.CancelledError:
break
except Exception as e:
logging.error(f"❌ 出站循环异常(已恢复): {e}")
await asyncio.sleep(1)
continue
# ── 主入口 ───────────────────────────────────────────────
async def main():
retry_delay = 1
max_delay = 60
while True:
bot = None
inbound_task = None
outbound_task = None
try:
bot = AgentBot()
bot.register_plugin('xep_0030')
bot.register_plugin('xep_0045')
bot.register_plugin('xep_0199')
bot.connect(host='127.0.0.1', port=5222)
await asyncio.wait_for(bot.ready.wait(), timeout=30)
logging.info(f"{AGENT_NAME} XMPP 就绪")
retry_delay = 1
# 启动独立处理循环
inbound_task = asyncio.create_task(process_inbound())
outbound_task = asyncio.create_task(drain_outbound(bot))
while True:
await asyncio.sleep(15)
if not bot.is_connected():
logging.warning("检测到断线,准备重连...")
break
# XMPP心跳检测:如果run_filters任务挂了,is_connected可能仍为True
try:
ping_ok = await asyncio.wait_for(
bot.plugin['xep_0199'].send_ping(AGENT_JID, timeout=5),
timeout=8
)
if not ping_ok:
logging.warning("XMPP心跳超时(XEP-0199),准备重连...")
break
except asyncio.TimeoutError:
logging.warning("XMPP心跳超时,准备重连...")
break
except Exception:
# xep_0199可能因run_filters已死而抛出异常
logging.warning("XMPP心跳异常(run_filters可能已死),准备重连...")
break
except asyncio.TimeoutError:
logging.warning("连接超时,准备重连...")
except Exception as e:
logging.error(f"❌ 主循环错误: {e}")
finally:
# 取消任务但不丢队列
for t in [inbound_task, outbound_task]:
if t and not t.done():
t.cancel()
if bot:
try:
bot.disconnect()
except:
pass
# 等待旧session完全释放,防止两个bot抢资源
await asyncio.sleep(2)
logging.info(f"⏳ 等待 {retry_delay} 秒后重连...")
await asyncio.sleep(retry_delay)
retry_delay = min(retry_delay * 2, max_delay)
if __name__ == '__main__':
try:
asyncio.run(main())
except KeyboardInterrupt:
pass
+5 -1
View File
@@ -1678,7 +1678,8 @@ def regenerate_all(stdout=True):
# 无行业映射时至少记录大盘宽度 # 无行业映射时至少记录大盘宽度
sector_ctx_str = f"大盘上涨比{market_breadth}%" sector_ctx_str = f"大盘上涨比{market_breadth}%"
new_entry = { new_entry = {
"code": code, "name": name, "price": price, "cost": cost, "code": code, "name": name, "price": price,
"cost": old_entry.get("cost", cost) if old_entry else cost, # 优先保留旧成本(holding.xls权威)
"shares": old_entry.get("shares", 0), # 保留持仓股数 "shares": old_entry.get("shares", 0), # 保留持仓股数
"avg_price": old_entry.get("avg_price", 0), # 保留持仓均价 "avg_price": old_entry.get("avg_price", 0), # 保留持仓均价
"action": result["action"], "action": result["action"],
@@ -1706,6 +1707,9 @@ def regenerate_all(stdout=True):
new_entry["created_at"] = old_entry["created_at"] new_entry["created_at"] = old_entry["created_at"]
else: else:
new_entry["created_at"] = result["reassessed_at"] new_entry["created_at"] = result["reassessed_at"]
# 保留 last_reassessed_priceper_stock_reassess 维护的防抖字段)
if old_entry.get("last_reassessed_price"):
new_entry["last_reassessed_price"] = old_entry["last_reassessed_price"]
# 自选股也写止盈位(用于RR校验),但标签用"目标参考"非"止盈" # 自选股也写止盈位(用于RR校验),但标签用"目标参考"非"止盈"
new_entry["take_profit"] = result.get("take_profit") new_entry["take_profit"] = result.get("take_profit")