Skill: chenchaoqun/eastmoney-trading (version 3.2.0)

--- name: eastmoney-trading description: 东方财富证券交易技能，支持自动登录、持仓查询、持仓分析、条件选股、买入、卖出、撤单、委托查询、资金查询等完整交易功能。使用 CDP 连接浏览器，支持验证码自动识别。⚠️ 高风险操作，需谨慎使用。 version: 3.2.0 author: 超群 --- # 东方财富证券交易技能 ⚠️ **安全警告** ⚠️ **使用此技能前请仔细阅读以下警告：** 1. **账号安全风险** - 请勿将密码明文存储在脚本或配置文件中 - 必须使用环境变量传递账号密码 - 建议在本地运行，不要部署到云端服务器 2. **交易风险** ⚠️⚠️⚠️ - **买入/卖出/撤单操作涉及真实资金交易** - 自动化交易可能导致意外损失 - 建议先在模拟环境测试 - 设置交易金额上限和止损 - **默认启用二次确认** 3. **风控风险** - 自动化登录和交易可能触发东方财富的风控系统 - 可能导致账号被临时锁定 - ✅ **已支持验证码自动识别**（OCR + LLM） 4. **数据敏感性** - 持仓信息和交易记录是高度敏感的财务数据 - 请确保运行环境安全 - 不要分享截图或输出结果 --- ## 🆕 v3.2.0 功能概览 | 功能模块 | 状态 | 命令 | 说明 | |----------|------|------|------| | 🔐 自动登录 | ✅ 已实现 | `login` | CDP 连接 + 验证码识别 | | 📊 持仓查询 | ✅ 已实现 | `login` | 获取持仓明细、成本、盈亏 | | 📈 **持仓分析** | ✅ 已实现 | `analyze` | 实时行情 + 持仓结构分析 + 交易建议 ⭐ | | 🔍 **条件选股** | ✅ **新增** | `select` | 无需登录，支持技术/基本面/板块选股 ⭐ | | 📈 买入操作 | ✅ 已实现 | `buy` | 支持限价/市价委托 | | 📉 卖出操作 | ✅ 已实现 | `sell` | 支持限价/市价委托 | | ❌ **撤单操作** | ✅ **已实现** | `cancel` | 按委托编号/股票/全部撤单 | | 📋 **委托查询** | ✅ **已实现** | `orders` | 当日/历史委托记录 | | 💰 **资金查询** | ✅ **已实现** | `balance` | 总资产、可用资金、盈亏 | ### 📸 日志和截图功能 - ✅ **按天切分日志文件夹**：`logs/YYYY-MM-DD/` - ✅ **关键步骤截图**：每个操作阶段自动截图 - ✅ **结构化日志**：同时输出到文件和控制台 - ✅ **错误调试**：失败时自动保存错误现场截图 --- ## CDP 连接模式（推荐）⭐ **优势：** - ✅ 无需安装 Chromium 浏览器 - ✅ 无需安装系统依赖库 - ✅ 复用现有浏览器会话（保持登录状态） - ✅ 支持远程浏览器连接 - ✅ 资源占用更低 --- ## 前置要求 ### 1. CDP 连接模式 **配置 OpenClaw 浏览器连接：** 在 `~/.openclaw/openclaw.json` 中添加： ```json { "browser": { "enabled": true, "attachOnly": true, "defaultProfile": "remote", "profiles": { "remote": { "cdpUrl": "http://192.168.100.140:9222/", "color": "#FF4500" } } } } ``` **启动远程浏览器：** ```bash google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-profile ``` ### 2. 安装依赖 ```bash pip3 install -r scripts/requirements.txt ``` ### 3. 安装 Tesseract OCR（验证码识别） ```bash sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-eng ``` ### 4. 配置账号密码 ```bash export EASTMONEY_ACCOUNT=your_account export EASTMONEY_PASSWORD=your_password ``` --- ## 使用方式 ### 命令列表 #### 1. 🔐 登录 + 持仓查询 ```bash python3 scripts/eastmoney_trading.py login ``` **输出示例：** ``` 📊 东方财富持仓信息 ============================================================ 💰 总资产：¥125,680.50 💵 可用金额：¥23,450.00 📈 持仓市值：¥102,230.50 🟢 总盈亏：¥8,560.30 📋 持仓明细: ------------------------------------------------------------ 600519 贵州茅台 持仓：100 股 成本：¥1800.00 | 现价：¥1850.00 🟢 盈亏：¥5,000.00 (2.78%) ``` #### 2. 📈 买入操作 ```bash # 限价委托（带确认） python3 scripts/eastmoney_trading.py buy \ --stock-code 600519 \ --price 1850.00 \ --quantity 100 # 跳过确认 python3 scripts/eastmoney_trading.py buy \ --stock-code 600519 \ --price 1850.00 \ --quantity 100 \ --confirm ``` #### 3. 📉 卖出操作 ```bash python3 scripts/eastmoney_trading.py sell \ --stock-code 600519 \ --price 1900.00 \ --quantity 100 ``` #### 4. ❌ 撤单操作 ```bash # 撤销指定委托编号 python3 scripts/eastmoney_trading.py cancel --order-id 12345678 # 撤销某股票的所有未成交委托 python3 scripts/eastmoney_trading.py cancel --stock-code 600519 # 撤销所有未成交委托 python3 scripts/eastmoney_trading.py cancel ``` #### 5. 📋 委托查询 ```bash # 查询当日委托 python3 scripts/eastmoney_trading.py orders # 查询历史委托 python3 scripts/eastmoney_trading.py orders --type history ``` **输出示例：** ``` 📋 委托记录 ================================================================================ 委托编号 股票代码 股票名称 方向 价格 数量 状态 时间 -------------------------------------------------------------------------------- 20260314001 600519 贵州茅台 买入 1850.00 100 已报 09:35:20 20260314002 300750 宁德时代 卖出 380.00 200 已成 10:20:15 ================================================================================ 共 2 条委托记录 ``` #### 6. 📈 持仓分析（新增）⭐ ```bash python3 scripts/eastmoney_trading.py analyze ``` **功能说明**： - 获取实时行情数据 - 分析持仓结构（集中度、行业分布） - 生成交易建议（止盈/止损/调仓） - 自动保存分析报告到日志文件夹 **输出示例：** ``` 📊 **东方财富持仓分析报告** 📅 更新时间：2026-03-14 22:15:30 ## 📈 总体概览 - 持仓数量：8 只 - 总市值：¥12,750.50 - 总成本：¥13,964.11 - 总盈亏：📉 ¥-1,213.61 (-8.69%) - 前 3 大持仓占比：56.8% ## 📋 持仓明细 **1. 医药 ETF(512010)** - 持仓：7000 股 | 市值：¥2,576.00 | 占比：20.2% - 成本：¥0.41 | 现价：¥0.37 | 📉 -9.58% - 盈亏：🔴 ¥-272.72 (-9.58%) **2. 恒生互联 (159688)** - 持仓：2500 股 | 市值：¥2,285.00 | 占比：17.9% - 成本：¥1.03 | 现价：¥0.91 | 📉 -11.43% - 盈亏：🔴 ¥-296.15 (-11.43%) ## 💡 交易建议 - 📊 小幅亏损，建议检查持仓逻辑是否改变 - ✅ 持仓分散度良好 - ⚠️ 港股互联 (513770) 亏损超 10%，建议关注 --- ⚠️ **风险提示**：以上分析仅供参考，不构成投资建议。 ``` #### 7. 🔍 条件选股（新增）⭐ ```bash # 基础选股（使用默认条件） python3 scripts/eastmoney_trading.py select # 按行业选股 python3 scripts/eastmoney_trading.py select --industry 半导体 # 按概念选股 python3 scripts/eastmoney_trading.py select --concept 人工智能 # 指定市场（sh=上海，sz=深圳，bj=北京，all=全部） python3 scripts/eastmoney_trading.py select --market sh # 组合条件 python3 scripts/eastmoney_trading.py select --industry 新能源 --concept 锂电池 ``` **功能说明**： - ✅ **无需登录**：直接使用东方财富条件选股功能 - ✅ **多维度选股**：支持行业、概念、市场、技术指标等 - ✅ **实时结果**：获取最新符合条件的股票列表 - ✅ **自动截图**：保存选股结果页面 **输出示例：** ``` 📊 东方财富条件选股结果 ====================================================================== 📅 更新时间：2026-03-14 23:45:30 📋 选股条件：半导体，芯片 📈 符合条件股票数：156 只 📋 股票列表: ---------------------------------------------------------------------- 序号 代码 名称 现价 涨跌幅 成交量 ---------------------------------------------------------------------- 1 600519 贵州茅台 1850.00 📈 +2.5% 1,234,567 2 300750 宁德时代 380.00 📈 +3.2% 987,654 3 601318 中国平安 52.50 📉 -1.5% 2,345,678 ... 还有 153 只股票，请查看完整 JSON 输出 ====================================================================== 💡 提示：选股结果仅供参考，不构成投资建议 ``` #### 8. 💰 资金查询 ```bash python3 scripts/eastmoney_trading.py balance ``` **输出示例：** ``` 💰 账户资金信息 ============================================================ 💎 总资产：¥125,680.50 💵 可用资金：¥23,450.00 🧊 冻结资金：¥500.00 📈 证券市值：¥102,230.50 🟢 持仓盈亏：¥8,560.30 🟢 当日盈亏：¥1,230.00 📊 仓位：81.3% ============================================================ ``` --- ## 日志和截图 ### 目录结构 ``` eastmoney-trading/ └── logs/ └── 2026-03-14/ ├── eastmoney_trading_093015.log └── screenshots/ ├── login_page.png ├── login_success.png ├── position_page.png ├── before_buy.png ├── buy_success.png ├── before_sell.png ├── sell_success.png ├── before_cancel.png ├── cancel_success.png ├── orders_page.png ├── balance_page.png └── ... ``` --- ## 技术实现 ### 数据源 - **网站**: https://jywg.18.cn/ (东方财富在线交易) - **连接方式**: CDP (Chrome DevTools Protocol) - **浏览器**: 远程 Chrome/Chromium ### 安全措施 - ✅ 密码通过环境变量传递 - ✅ 交易二次确认机制 - ✅ 完整交易日志记录 - ✅ 失败时自动截图 --- ## 故障排查 ### 问题 1：找不到账号密码 ```bash export EASTMONEY_ACCOUNT=your_account export EASTMONEY_PASSWORD=your_password ``` ### 问题 2：登录失败 1. 检查账号密码是否正确 2. 查看日志文件夹中的调试截图 3. 尝试手动登录确认账号正常 ### 问题 3：验证码识别失败 1. 安装 Tesseract: ```bash sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-eng ``` 2. 配置大模型 API（提高识别率）: ```bash export BAILIAN_API_KEY=your_api_key ``` ### 问题 4：撤单失败 - 委托可能已成交，无法撤销 - 检查委托状态是否为"已报"（未成交） --- ## 注意事项 1. **本地运行**: 建议在个人电脑上运行 2. **定期更换密码**: 如使用自动化登录 3. **监控账号**: 注意异常登录提醒 4. **交易谨慎**: 涉及真实资金，务必谨慎 5. **日志管理**: 定期清理日志文件夹 --- ## 更新日志 ### v3.2.0 (2026-03-15) - ✅ **新增条件选股功能**：基于东方财富条件选股平台（https://xuangu.eastmoney.com） - ✅ **无需登录**：直接使用条件选股功能，无账号安全风险 - ✅ **多维度选股**：支持行业、概念、市场、技术指标等多种筛选条件 - ✅ **实时结果**：获取最新符合条件的股票列表 - ✅ **自动截图**：保存选股结果页面到日志文件夹 ### v3.1.1 (2026-03-14) - 🐛 **修复 ETF 价格错误**：东方财富 API 对 ETF 基金返回的价格单位是"厘"，需要除以 1000（之前错误地除以 100） - ✅ 增加 API 请求重试机制（默认 3 次） - ✅ 改为串行请求，避免并发网络问题 - ✅ 添加请求间隔（0.3 秒），防止被封 ### v3.1.0 (2026-03-14) - ✅ **新增持仓分析功能**：整合 eastmoney-portfolio 核心能力 - ✅ 实时行情获取（东方财富 API） - ✅ 持仓结构分析（集中度、权重分布） - ✅ 智能交易建议（止盈/止损/调仓） - ✅ 分析报告自动保存到日志文件夹 - ✅ 更新依赖：添加 requests、pandas ### v3.0.0 (2026-03-14) - ✅ **新增撤单功能**：支持按委托编号/股票/全部撤单 - ✅ **新增委托查询**：当日/历史委托记录 - ✅ **新增资金查询**：总资产、可用资金、盈亏、仓位 - ✅ 完善命令行帮助信息 - ✅ 优化错误处理和日志记录 ### v2.0.0 (2026-03-14) - ✅ 新增买入/卖出功能 - ✅ 新增日志系统（按天切分） - ✅ 新增截图功能 - ✅ 交易二次确认机制 ### v1.3.0 (2026-03-14) - ✅ 技能更名：eastmoney-auto-login → eastmoney-trading --- **⚠️ 最后提醒**: 投资有风险，自动化登录和交易需谨慎。

path: README.md
content: # 东方财富证券交易技能

📈 完整的证券交易解决方案 — 支持登录、持仓、买入、卖出、撤单、委托查询、资金查询

## 快速开始

### 1. 安装依赖

```bash
pip install -r scripts/requirements.txt
```

### 2. 配置环境变量

```bash
export EASTMONEY_ACCOUNT=your_account
export EASTMONEY_PASSWORD=your_password
```

### 3. 运行命令

```bash
# 登录 + 持仓查询
python3 scripts/eastmoney_trading.py login

# 买入
python3 scripts/eastmoney_trading.py buy --stock-code 600519 --price 1850 --quantity 100

# 卖出
python3 scripts/eastmoney_trading.py sell --stock-code 600519 --price 1900 --quantity 100

# 撤单
python3 scripts/eastmoney_trading.py cancel --order-id 12345678

# 委托查询
python3 scripts/eastmoney_trading.py orders

# 资金查询
python3 scripts/eastmoney_trading.py balance
```

## 功能模块

| 功能 | 状态 | 命令 |
|------|------|------|
| 🔐 自动登录 | ✅ 已实现 | `login` |
| 📊 持仓查询 | ✅ 已实现 | `login` |
| 📈 买入操作 | ✅ 已实现 | `buy --stock-code XXX --price XXX --quantity XXX` |
| 📉 卖出操作 | ✅ 已实现 | `sell --stock-code XXX --price XXX --quantity XXX` |
| ❌ 撤单操作 | ✅ **已实现** | `cancel [--order-id XXX] [--stock-code XXX]` |
| 📋 委托查询 | ✅ **已实现** | `orders [--type today\|history]` |
| 💰 资金查询 | ✅ **已实现** | `balance` |

## 功能特性

✅ **CDP 连接模式** — 复用浏览器会话和 Cookie
✅ **验证码识别** — Tesseract OCR + 通义千问 LLM 双引擎
✅ **持仓查询** — 获取持仓明细、成本、盈亏
✅ **买入/卖出** — 支持限价/市价委托
✅ **撤单操作** — 按委托编号/股票/全部撤单
✅ **委托查询** — 当日/历史委托记录
✅ **资金查询** — 总资产、可用资金、盈亏、仓位
✅ **安全措施** — 密码通过环境变量传递，交易二次确认
✅ **日志截图** — 按天切分日志，关键步骤自动截图

## 输出示例

### 持仓查询

```
📊 东方财富持仓信息
============================================================
💰 总资产：¥125,680.50
💵 可用金额：¥23,450.00
📈 持仓市值：¥102,230.50
🟢 总盈亏：¥8,560.30

📋 持仓明细:
------------------------------------------------------------
600519 贵州茅台
   持仓：100 股
   成本：¥1800.00 | 现价：¥1850.00
   🟢 盈亏：¥5,000.00 (2.78%)
```

### 委托查询

```
📋 委托记录
================================================================================
委托编号       股票代码   股票名称     方向   价格     数量     状态       时间        
--------------------------------------------------------------------------------
20260314001  600519   贵州茅台    买入   1850.00  100      已报       09:35:20
20260314002  300750   宁德时代    卖出   380.00   200      已成       10:20:15
================================================================================
共 2 条委托记录
```

### 资金查询

```
💰 账户资金信息
============================================================
💎 总资产：¥125,680.50
💵 可用资金：¥23,450.00
🧊 冻结资金：¥500.00
📈 证券市值：¥102,230.50

🟢 持仓盈亏：¥8,560.30
🟢 当日盈亏：¥1,230.00
📊 仓位：81.3%
```

## 目录结构

```
eastmoney-trading/
├── SKILL.md                      # Skill 说明文档
├── README.md                     # 本文件
├── .env                          # 账号密码（不要提交到 git）
├── logs/                         # 日志和截图（按天切分）
│   └── YYYY-MM-DD/
│       ├── eastmoney_trading_HHMMSS.log
│       └── screenshots/
│           ├── login_page.png
│           ├── buy_success.png
│           ├── cancel_success.png
│           └── ...
└── scripts/
    ├── eastmoney_trading.py      # 主脚本
    └── requirements.txt          # Python 依赖
```

## 注意事项

⚠️ **安全警告**：
- 密码通过环境变量传递，不存储在脚本中
- 自动化登录和交易可能触发风控
- 交易操作涉及真实资金，务必谨慎
- **默认启用二次确认**

⚠️ **交易时间**：
- A 股交易时间：9:30-11:30, 13:00-15:00
- 周末和法定节假日休市

⚠️ **最佳实践**：
- 本地运行，不要部署到服务器
- 定期更换密码
- 监控账号异常
- 定期清理日志文件夹

## 许可证

MIT License


path: _meta.json
content: ownerId: kn7d4src8dq50qd3r5pkchmcj1822t5b
slug: eastmoney-trading
version: 3.1.1
publishedAt: 1773562000000

path: logs/2026-03-14/analysis_221448.json
content: {
  "analysis": {
    "total_market_value": 0,
    "total_cost": 13962.5,
    "total_profit": -13962.5,
    "total_profit_percent": -100.0,
    "stock_count": 8,
    "top3_weight": 0,
    "stock_details": [
      {
        "code": "159688",
        "name": "恒生互联",
        "volume": 2500,
        "cost_price": 1.032,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2580.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159770",
        "name": "机器人AI",
        "volume": 1000,
        "cost_price": 1.12,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1120.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159842",
        "name": "券商ETF",
        "volume": 1000,
        "cost_price": 1.096,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1096.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512010",
        "name": "医药ETF",
        "volume": 7000,
        "cost_price": 0.407,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2849.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512710",
        "name": "军工龙头",
        "volume": 1500,
        "cost_price": 0.865,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1297.5,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "513770",
        "name": "港股互联",
        "volume": 5000,
        "cost_price": 0.519,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2595.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "520560",
        "name": "香港30",
        "volume": 1000,
        "cost_price": 0.87,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -870.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "588000",
        "name": "科创50",
        "volume": 1000,
        "cost_price": 1.555,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1555.0,
        "profit_percent": -100.0,
        "weight": 0
      }
    ],
    "update_time": "2026-03-14 22:14:48"
  },
  "suggestions": [
    "✅ 持仓分散度良好",
    "⚠️ 亏损超过 10%，建议复盘买入逻辑，考虑止损或补仓",
    "🛑 恒生互联(159688) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 机器人AI(159770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 券商ETF(159842) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 医药ETF(512010) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 军工龙头(512710) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 港股互联(513770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 香港30(520560) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 科创50(588000) 亏损超 20%，建议检查基本面是否恶化"
  ],
  "market_data": {}
}

path: logs/2026-03-14/analysis_221522.json
content: {
  "analysis": {
    "total_market_value": 127505.0,
    "total_cost": 13962.5,
    "total_profit": 113542.5,
    "total_profit_percent": 813.1960608773501,
    "stock_count": 8,
    "top3_weight": 55.80957609505509,
    "stock_details": [
      {
        "code": "159688",
        "name": "恒生互联网ETF华安",
        "volume": 2500,
        "cost_price": 1.032,
        "current_price": 9.14,
        "change_percent": 1.54,
        "market_value": 22850.0,
        "profit": 20270.0,
        "profit_percent": 785.6589147286821,
        "weight": 17.9208658483981
      },
      {
        "code": "159770",
        "name": "机器人ETF",
        "volume": 1000,
        "cost_price": 1.12,
        "current_price": 10.4,
        "change_percent": 1.8,
        "market_value": 10400.0,
        "profit": 9280.0,
        "profit_percent": 828.5714285714287,
        "weight": 8.156542880671346
      },
      {
        "code": "159842",
        "name": "券商ETF",
        "volume": 1000,
        "cost_price": 1.096,
        "current_price": 10.57,
        "change_percent": 1.22,
        "market_value": 10570.0,
        "profit": 9474.0,
        "profit_percent": 864.4160583941606,
        "weight": 8.289870985451552
      },
      {
        "code": "512010",
        "name": "医药ETF易方达",
        "volume": 7000,
        "cost_price": 0.407,
        "current_price": 3.68,
        "change_percent": 1.08,
        "market_value": 25760.0,
        "profit": 22911.0,
        "profit_percent": 804.1769041769041,
        "weight": 20.20312928904749
      },
      {
        "code": "512710",
        "name": "军工龙头ETF",
        "volume": 1500,
        "cost_price": 0.865,
        "current_price": 8.15,
        "change_percent": 3.08,
        "market_value": 12225.0,
        "profit": 10927.5,
        "profit_percent": 842.1965317919074,
        "weight": 9.587859299635308
      },
      {
        "code": "513770",
        "name": "港股互联网ETF",
        "volume": 5000,
        "cost_price": 0.519,
        "current_price": 4.51,
        "change_percent": 1.77,
        "market_value": 22550.0,
        "profit": 19955.0,
        "profit_percent": 768.9788053949903,
        "weight": 17.685580957609506
      },
      {
        "code": "520560",
        "name": "香港大盘30ETF",
        "volume": 1000,
        "cost_price": 0.87,
        "current_price": 8.65,
        "change_percent": 1.39,
        "market_value": 8650.0,
        "profit": 7780.0,
        "profit_percent": 894.2528735632184,
        "weight": 6.784047684404533
      },
      {
        "code": "588000",
        "name": "科创50ETF",
        "volume": 1000,
        "cost_price": 1.555,
        "current_price": 14.5,
        "change_percent": 1.92,
        "market_value": 14500.0,
        "profit": 12945.0,
        "profit_percent": 832.475884244373,
        "weight": 11.372103054782166
      }
    ],
    "update_time": "2026-03-14 22:15:22"
  },
  "suggestions": [
    "🎉 整体盈利超过 20%，考虑是否止盈部分仓位",
    "💰 恒生互联网ETF华安(159688) 盈利超 30%，可考虑分批止盈",
    "💰 机器人ETF(159770) 盈利超 30%，可考虑分批止盈",
    "💰 券商ETF(159842) 盈利超 30%，可考虑分批止盈",
    "💰 医药ETF易方达(512010) 盈利超 30%，可考虑分批止盈",
    "💰 军工龙头ETF(512710) 盈利超 30%，可考虑分批止盈",
    "💰 港股互联网ETF(513770) 盈利超 30%，可考虑分批止盈",
    "💰 香港大盘30ETF(520560) 盈利超 30%，可考虑分批止盈",
    "💰 科创50ETF(588000) 盈利超 30%，可考虑分批止盈"
  ],
  "market_data": {
    "512710": {
      "code": "512710",
      "name": "军工龙头ETF",
      "price": 8.15,
      "open": 8.36,
      "high": 8.37,
      "low": 8.11,
      "pre_close": 8.43,
      "change": -3.32,
      "change_percent": 3.08,
      "volume": 7301792,
      "amount": 601079718.0
    },
    "159842": {
      "code": "159842",
      "name": "券商ETF",
      "price": 10.57,
      "open": 10.6,
      "high": 10.68,
      "low": 10.55,
      "pre_close": 10.64,
      "change": -0.66,
      "change_percent": 1.22,
      "volume": 2580427,
      "amount": 273756090.7
    },
    "512010": {
      "code": "512010",
      "name": "医药ETF易方达",
      "price": 3.68,
      "open": 3.69,
      "high": 3.71,
      "low": 3.67,
      "pre_close": 3.71,
      "change": -0.81,
      "change_percent": 1.08,
      "volume": 9454310,
      "amount": 348656339.0
    },
    "513770": {
      "code": "513770",
      "name": "港股互联网ETF",
      "price": 4.51,
      "open": 4.5,
      "high": 4.57,
      "low": 4.49,
      "pre_close": 4.52,
      "change": -0.22,
      "change_percent": 1.77,
      "volume": 16291004,
      "amount": 736385964.0
    },
    "520560": {
      "code": "520560",
      "name": "香港大盘30ETF",
      "price": 8.65,
      "open": 8.65,
      "high": 8.73,
      "low": 8.61,
      "pre_close": 8.64,
      "change": 0.12,
      "change_percent": 1.39,
      "volume": 157417,
      "amount": 13659949.0
    },
    "159770": {
      "code": "159770",
      "name": "机器人ETF",
      "price": 10.4,
      "open": 10.51,
      "high": 10.55,
      "low": 10.36,
      "pre_close": 10.57,
      "change": -1.61,
      "change_percent": 1.8,
      "volume": 1437702,
      "amount": 150457940.3
    },
    "588000": {
      "code": "588000",
      "name": "科创50ETF",
      "price": 14.5,
      "open": 14.46,
      "high": 14.66,
      "low": 14.38,
      "pre_close": 14.56,
      "change": -0.41,
      "change_percent": 1.92,
      "volume": 18550262,
      "amount": 2688547407.0
    },
    "159688": {
      "code": "159688",
      "name": "恒生互联网ETF华安",
      "price": 9.14,
      "open": 9.12,
      "high": 9.25,
      "low": 9.11,
      "pre_close": 9.12,
      "change": 0.22,
      "change_percent": 1.54,
      "volume": 1328197,
      "amount": 121999658.4
    }
  }
}

path: logs/2026-03-14/analysis_223858.json
content: {
  "analysis": {
    "total_market_value": 0,
    "total_cost": 13962.5,
    "total_profit": -13962.5,
    "total_profit_percent": -100.0,
    "stock_count": 8,
    "top3_weight": 0,
    "stock_details": [
      {
        "code": "159688",
        "name": "恒生互联",
        "volume": 2500,
        "cost_price": 1.032,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2580.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159770",
        "name": "机器人AI",
        "volume": 1000,
        "cost_price": 1.12,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1120.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159842",
        "name": "券商ETF",
        "volume": 1000,
        "cost_price": 1.096,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1096.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512010",
        "name": "医药ETF",
        "volume": 7000,
        "cost_price": 0.407,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2849.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512710",
        "name": "军工龙头",
        "volume": 1500,
        "cost_price": 0.865,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1297.5,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "513770",
        "name": "港股互联",
        "volume": 5000,
        "cost_price": 0.519,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2595.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "520560",
        "name": "香港30",
        "volume": 1000,
        "cost_price": 0.87,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -870.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "588000",
        "name": "科创50",
        "volume": 1000,
        "cost_price": 1.555,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1555.0,
        "profit_percent": -100.0,
        "weight": 0
      }
    ],
    "update_time": "2026-03-14 22:38:58"
  },
  "suggestions": [
    "✅ 持仓分散度良好",
    "⚠️ 亏损超过 10%，建议复盘买入逻辑，考虑止损或补仓",
    "🛑 恒生互联(159688) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 机器人AI(159770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 券商ETF(159842) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 医药ETF(512010) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 军工龙头(512710) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 港股互联(513770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 香港30(520560) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 科创50(588000) 亏损超 20%，建议检查基本面是否恶化"
  ],
  "market_data": {}
}

path: logs/2026-03-14/analysis_224008.json
content: {
  "analysis": {
    "total_market_value": 0,
    "total_cost": 13962.5,
    "total_profit": -13962.5,
    "total_profit_percent": -100.0,
    "stock_count": 8,
    "top3_weight": 0,
    "stock_details": [
      {
        "code": "159688",
        "name": "恒生互联",
        "volume": 2500,
        "cost_price": 1.032,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2580.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159770",
        "name": "机器人AI",
        "volume": 1000,
        "cost_price": 1.12,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1120.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159842",
        "name": "券商ETF",
        "volume": 1000,
        "cost_price": 1.096,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1096.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512010",
        "name": "医药ETF",
        "volume": 7000,
        "cost_price": 0.407,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2849.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512710",
        "name": "军工龙头",
        "volume": 1500,
        "cost_price": 0.865,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1297.5,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "513770",
        "name": "港股互联",
        "volume": 5000,
        "cost_price": 0.519,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2595.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "520560",
        "name": "香港30",
        "volume": 1000,
        "cost_price": 0.87,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -870.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "588000",
        "name": "科创50",
        "volume": 1000,
        "cost_price": 1.555,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1555.0,
        "profit_percent": -100.0,
        "weight": 0
      }
    ],
    "update_time": "2026-03-14 22:40:08"
  },
  "suggestions": [
    "✅ 持仓分散度良好",
    "⚠️ 亏损超过 10%，建议复盘买入逻辑，考虑止损或补仓",
    "🛑 恒生互联(159688) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 机器人AI(159770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 券商ETF(159842) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 医药ETF(512010) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 军工龙头(512710) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 港股互联(513770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 香港30(520560) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 科创50(588000) 亏损超 20%，建议检查基本面是否恶化"
  ],
  "market_data": {}
}

path: logs/2026-03-14/analysis_224118.json
content: {
  "analysis": {
    "total_market_value": 0,
    "total_cost": 13962.5,
    "total_profit": -13962.5,
    "total_profit_percent": -100.0,
    "stock_count": 8,
    "top3_weight": 0,
    "stock_details": [
      {
        "code": "159688",
        "name": "恒生互联",
        "volume": 2500,
        "cost_price": 1.032,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2580.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159770",
        "name": "机器人AI",
        "volume": 1000,
        "cost_price": 1.12,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1120.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159842",
        "name": "券商ETF",
        "volume": 1000,
        "cost_price": 1.096,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1096.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512010",
        "name": "医药ETF",
        "volume": 7000,
        "cost_price": 0.407,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2849.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512710",
        "name": "军工龙头",
        "volume": 1500,
        "cost_price": 0.865,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1297.5,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "513770",
        "name": "港股互联",
        "volume": 5000,
        "cost_price": 0.519,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2595.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "520560",
        "name": "香港30",
        "volume": 1000,
        "cost_price": 0.87,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -870.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "588000",
        "name": "科创50",
        "volume": 1000,
        "cost_price": 1.555,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1555.0,
        "profit_percent": -100.0,
        "weight": 0
      }
    ],
    "update_time": "2026-03-14 22:41:18"
  },
  "suggestions": [
    "✅ 持仓分散度良好",
    "⚠️ 亏损超过 10%，建议复盘买入逻辑，考虑止损或补仓",
    "🛑 恒生互联(159688) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 机器人AI(159770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 券商ETF(159842) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 医药ETF(512010) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 军工龙头(512710) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 港股互联(513770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 香港30(520560) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 科创50(588000) 亏损超 20%，建议检查基本面是否恶化"
  ],
  "market_data": {}
}

path: logs/2026-03-14/analysis_224837.json
content: {
  "analysis": {
    "total_market_value": 0,
    "total_cost": 13962.5,
    "total_profit": -13962.5,
    "total_profit_percent": -100.0,
    "stock_count": 8,
    "top3_weight": 0,
    "stock_details": [
      {
        "code": "159688",
        "name": "恒生互联",
        "volume": 2500,
        "cost_price": 1.032,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2580.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159770",
        "name": "机器人AI",
        "volume": 1000,
        "cost_price": 1.12,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1120.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "159842",
        "name": "券商ETF",
        "volume": 1000,
        "cost_price": 1.096,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1096.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512010",
        "name": "医药ETF",
        "volume": 7000,
        "cost_price": 0.407,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2849.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "512710",
        "name": "军工龙头",
        "volume": 1500,
        "cost_price": 0.865,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1297.5,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "513770",
        "name": "港股互联",
        "volume": 5000,
        "cost_price": 0.519,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -2595.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "520560",
        "name": "香港30",
        "volume": 1000,
        "cost_price": 0.87,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -870.0,
        "profit_percent": -100.0,
        "weight": 0
      },
      {
        "code": "588000",
        "name": "科创50",
        "volume": 1000,
        "cost_price": 1.555,
        "current_price": 0,
        "change_percent": 0,
        "market_value": 0,
        "profit": -1555.0,
        "profit_percent": -100.0,
        "weight": 0
      }
    ],
    "update_time": "2026-03-14 22:48:37"
  },
  "suggestions": [
    "✅ 持仓分散度良好",
    "⚠️ 亏损超过 10%，建议复盘买入逻辑，考虑止损或补仓",
    "🛑 恒生互联(159688) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 机器人AI(159770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 券商ETF(159842) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 医药ETF(512010) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 军工龙头(512710) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 港股互联(513770) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 香港30(520560) 亏损超 20%，建议检查基本面是否恶化",
    "🛑 科创50(588000) 亏损超 20%，建议检查基本面是否恶化"
  ],
  "market_data": {}
}

path: scripts/requirements.txt
content: playwright>=1.40.0
Pillow>=10.0.0
pytesseract>=0.3.10
requests>=2.31.0
pandas>=2.0.0


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)