← Back to Skills Marketplace
jayden-zhong

持仓诊断分析

by Jayden-zhong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
87
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install holdings-analysis
Description
实时诊断持仓,结合腾讯行情和技术指标,计算买卖评分及状态,给出操作建议和盈亏情况。
README (SKILL.md)

持仓诊断与分析 (Holdings Analysis)\r

\r

简介\r

\r 持仓实时诊断工具。读取持仓列表,调用腾讯API获取实时行情,结合技术指标计算买入评分(M/A/R/V四维)和卖出评分,给出PASS/FAIL状态和操作信号。\r \r ---\r \r

核心文件\r

\r | 文件 | 用途 |\r |------|------|\r | _holdings_std.py | 持仓数据(成本价、买入日期) |\r | check_holdings_v4.py | 主脚本:买入评分 + M/A/R/V + 卖出评分 + PASS/FAIL |\r | analyze_holdings.py | v1版持仓分析 |\r | analyze_holdings_v2.py | v2版持仓分析 |\r | check_holdings_detail.py | 持仓详情(含趋势追踪) |\r | check_holdings_trend.py | 持仓趋势追踪 |\r | run_holdings.py | 快速运行入口 |\r \r ---\r \r

使用方法\r

\r

# 标准持仓诊断\r
python check_holdings_v4.py\r
\r
# 持仓趋势追踪\r
python check_holdings_trend.py\r
```\r
\r
---\r
\r
## 评分体系\r
\r
### 买入评分(满分100)\r
- **PASS** 阈值:≥55分,进入趋势合格池\r
- **FAIL** 阈值:\x3C55分,不符合趋势选股标准\r
\r
### 卖出评分(满分100)\r
- 评分越高代表风险越大\r
- 参考阈值:≥25分考虑分批止盈,≥40分强烈建议离场\r
\r
### M/A/R/V 四维\r
- **M**:动能(MACD方向)\r
- **A**:结构(均线排列)\r
- **R**:RSI强弱\r
- **V**:量价配合\r
\r
---\r
\r
## 输出格式\r
\r
```\r
代码 名称   评分  M/A/R/V   卖出评分  状态  盈亏%\r
000682 东方电子  59  21/20/18/0  20  PASS  -1.1%\r
```\r
\r
---\r
\r
## 持仓数据维护\r
\r
编辑 `_holdings_std.py` 中的 `HOLDINGS` 列表添加新持仓:\r
```python\r
HOLDINGS = [\r
    {"code": "000682", "buy_price": 13.20, "buy_date": "2026-03-30"},\r
    {"code": "300529", "buy_price": 18.60, "buy_date": "2026-04-22"},\r
]\r
```\r
\r
---\r
\r
## 免责声明\r
\r
本系统仅供学习研究使用,不构成任何投资建议。\r
Usage Guidance
要点和建议: - 风险概览:代码总体与“持仓诊断”用途一致,但含有若干令人担忧的实现细节:硬编码的绝对 Windows 路径会读取/写入用户 C:\Users\Administrator\.qclaw\... 下的文件(可能不存在,但若存在会被访问或覆盖);从远端响应使用 eval() 解析,存在远程代码注入风险。 - 在安装/运行前应采取的步骤: 1) 在隔离环境(容器或虚拟机)中先运行,不要直接在生产机器或含敏感数据的主机上执行。 2) 审阅并修改源码: - 将所有绝对路径改为相对路径或可配置路径(并在 skill.json 中声明),避免访问用户主目录以外的内容。 - 用安全的解析替代 eval(例如 json.loads 或专门的文本解析),不要对远端响应调用 eval。 3) 如果你只想用功能的一部分,运行仅包含 check_holdings_v4.py 的副本,并检查/编辑 _holdings_std.py 放入你的持仓数据;避免运行 analyze_holdings.py 和 check_holdings_detail.py,除非已修正路径。 4) 若运行,先在空目录中执行并检查产生的输出文件(holdings_result.json、holdings_analysis.txt、data/recommendation_tracking.json 等),并确认不会覆盖重要文件。 - 如果你不熟悉这些改动或无法在隔离环境中测试,建议不要安装/运行该 skill,直到作者修复:移除硬编码路径、替换 eval、并在 SKILL.md 与 skill.json 中明确列出所有读写路径和网络端点。
Capability Analysis
Type: OpenClaw Skill Name: holdings-analysis Version: 1.0.0 The skill bundle is a stock analysis tool that exhibits several high-risk coding practices and environment-specific configurations. Specifically, `check_holdings_v4.py` uses `eval()` on data retrieved from a remote API and `exec()` to execute local script content, both of which are significant security vulnerabilities. Additionally, multiple files including `_holdings_std.py`, `analyze_holdings.py`, and `trend_scanner.py` contain hardcoded absolute paths to a specific Windows user profile (`C:\Users\Administrator`), which is highly irregular for a portable skill and suggests it was designed for a specific, potentially privileged environment. While the logic appears aligned with financial analysis, these vulnerabilities and the lack of path sanitization pose a risk to the host system.
Capability Assessment
Purpose & Capability
技能名/描述与大多数代码文件(行情获取、指标计算、买卖评分、报告生成)一致;使用的网络端点(腾讯行情)也匹配声明目的。不过部分脚本(analyze_holdings.py、check_holdings_detail.py 等)引用了与 SKILL.md 未提及的绝对 Windows 用户路径(C:\Users\Administrator\.qclaw\...),这种硬编码与公开说明不一致,显示该包混入了开发者本地环境依赖。
Instruction Scope
SKILL.md 指示运行 check_holdings_v4.py / check_holdings_trend.py 并编辑 _holdings_std.py,但代码包中还有其他脚本(analyze_holdings.py、check_holdings_detail.py、tracking.py 等)会访问/写入用户工作区路径和额外数据文件。SKILL.md 未说明这些脚本会读取 C:\Users\Administrator\.qclaw\workspace-ag01\data 下的文件或写入该处,存在未记录的数据访问行为(潜在隐私/机密文件泄露风险)。
Install Mechanism
无安装脚本(instruction-only + 内含源码),不会从不明 URL 下载或解压远程二进制;风险主要来自源码本身而不是安装过程。
Credentials
skill.json 和 SKILL.md 没有声明需要任何凭据或外部配置,但若干脚本尝试直接读取/写入用户主目录下的 .qclaw 工作区、data 文件(例如 holdings.json、_holdings_detail.json、holdings_analysis.json),这些路径未在元数据中声明。缺乏声明的文件/路径访问是不相称的:用户被告知只需编辑 _holdings_std.py,但其它脚本会访问其它位置。
Persistence & Privilege
技能没有设置 always:true,也没有修改其他技能配置。但多个脚本会在本地创建/更新数据文件(例如 data/recommendation_tracking.json、holdings_result.json、输出文本报告),会在磁盘留下持久数据。虽非直接越权,但写入与读取硬编码路径可能覆盖或泄露本地数据,应谨慎。
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install holdings-analysis
  3. After installation, invoke the skill by name or use /holdings-analysis
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
v1.0.0: 持仓诊断系统,集成买入评分(M/A/R/V四维)+卖出评分+PASS/FAIL状态,支持腾讯API实时行情
Metadata
Slug holdings-analysis
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 持仓诊断分析?

实时诊断持仓,结合腾讯行情和技术指标,计算买卖评分及状态,给出操作建议和盈亏情况。 It is an AI Agent Skill for Claude Code / OpenClaw, with 87 downloads so far.

How do I install 持仓诊断分析?

Run "/install holdings-analysis" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 持仓诊断分析 free?

Yes, 持仓诊断分析 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 持仓诊断分析 support?

持仓诊断分析 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 持仓诊断分析?

It is built and maintained by Jayden-zhong (@jayden-zhong); the current version is v1.0.0.

💬 Comments