股票分析助手

v1.0.1

股票分析技能,提供买卖点判断、仓位管理、基本面分析。使用当用户需要分析股票投资价值时。

1· 95·1 current·1 all-time
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
The skill's name/description (股票分析) match the code and instructions: it fetches financial data via Tushare and produces analysis reports. Requested binary (python3) and TUSHARE_TOKEN are appropriate for this task. BAIDU_API_KEY is plausible for news search but the README/SKILL.md disagree about whether it is optional or required; TAVILY appears in docs as optional but is not declared required in registry metadata.
Instruction Scope
SKILL.md instructs use of Tushare, Baidu search and a global LLM for message/risks analysis. The __init__.py and scripts call Tushare and the platform's global LLM (ctx.claw.llm.chat), which is within scope. However the code shown does not clearly show active Baidu/Tavily API calls in the visible portions (the script is truncated), so the metadata/README sometimes claims optional integrations that are not obviously used—this is a documentation vs implementation mismatch to verify in the remaining code.
Install Mechanism
No install spec is provided (instruction-only install), which is low risk. The skill expects Python dependencies (tushare, pandas, numpy) but leaves installation to the user; that matches the README guidance. No external archives or arbitrary downloads are used.
Credentials
TUSHARE_TOKEN is justified and required. BAIDU_API_KEY is listed as required in the skill metadata/registry but described as optional elsewhere (README/SKILL.md); TAVILY_API_KEY is mentioned in docs as optional but not in the registry 'required' list. This mismatch is a documentation inconsistency. Also RELEASE_REPORT.md contains examples of former hard-coded API keys (now claimed removed) — that file itself exposes tokens if they are real, so verify and rotate any keys that might have been leaked.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or system-wide settings. It invokes the platform's global LLM (normal behavior) and runs as an on-demand skill.
Assessment
What to check before installing: - Verify TUSHARE_TOKEN is the only mandatory secret you must provide for core functionality; you can likely skip BAIDU_API_KEY / TAVILY_API_KEY unless you want news/deep-analysis features. The registry and docs disagree on whether BAIDU_API_KEY is required—confirm by inspecting the full script (the provided analyze_stock.py is truncated). - Inspect RELEASE_REPORT.md and other docs: they include examples of previously hard-coded API keys. Even if the current code reads keys from env, those documented tokens (if real) represent an exposure—do not reuse them and rotate any keys that may have been leaked. - Review the remainder of scripts/analyze_stock.py (the truncated portion) for any network endpoints beyond Tushare (HTTP calls, posting to external services). The visible code uses only Tushare and the platform LLM, which is expected; any other outbound endpoints should be justified. - Remember the skill sends gathered stock context (company name, metrics, etc.) to the platform LLM for analysis. If you are sensitive about sending this context to your configured LLM, consider limiting model access or reviewing what gets sent. - Ensure you install the Python dependencies (tushare, pandas, numpy) in a controlled environment, and run the script locally first with test/dummy API keys to observe behavior before granting real credentials. If you want, I can scan the remainder of analyze_stock.py (provide the truncated portion) to confirm there are no unexpected external calls or hidden behaviors.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

📈 Clawdis
Binspython3
EnvTUSHARE_TOKEN, BAIDU_API_KEY
fundamental-analysisvk979vb3z9j5gxnr821d8a79qvh83r7vhlatestvk970tbfrahdac80rxrn020tg4h83sgqequantitative-financevk979vb3z9j5gxnr821d8a79qvh83r7vhstock-analysisvk979vb3z9j5gxnr821d8a79qvh83r7vh
95downloads
1stars
2versions
Updated 3w ago
v1.0.1
MIT-0

股票分析技能

使用 Tushare 获取实时财务数据,结合百度搜索和全局大模型进行深度分析。

功能

  1. 核心价格区间与买卖点 - 基于 PE 分位计算 5 档估值区间
  2. 仓位管理策略 - 三步建仓法 + 止损止盈
  3. 关键观察信号 - 量能、均线、消息面实时分析
  4. 基本面分析 - 近三年财务数据 + 申万行业分类 + 同花顺概念
  5. BCG 业务矩阵 - 现金牛、明星、问题、瘦狗分析
  6. 利好与风险 - 使用全局大模型深度分析

使用方法

方式 1:命令行

python3 scripts/analyze_stock.py --stock 601117
python3 scripts/analyze_stock.py --stock 601117 --style balanced

方式 2:OpenClaw 标准调用

ctx.claw.skills.run("stock-analysis", {
    "stock_code": "601117",
    "style": "balanced"  # conservative/balanced/aggressive
})

输入参数

参数类型必填说明
stock_codestr股票代码(6 位数字)
stylestr投资风格(conservative/balanced/aggressive)

输出格式

{
  "stock": "601117",
  "name": "中国化学",
  "report": "完整分析报告",
  "analysis": "大模型分析的利好与风险因素",
  "model": "阿里云 Coding Plan(全局自动调用)"
}

依赖配置

方式 1:环境变量(推荐)

复制 .env.example.env 并填入你的 API key:

cd ~/.openclaw/workspace/skills/stock-analysis
cp .env.example .env
# 编辑 .env 文件,填入真实的 API key

方式 2:OpenClaw 配置

~/.openclaw/openclaw.json 中配置:

{
  "skills": {
    "entries": {
      "stock-analysis": {
        "env": {
          "TUSHARE_TOKEN": "your_tushare_token",
          "BAIDU_API_KEY": "your_baidu_api_key",
          "TAVILY_API_KEY": "your_tavily_api_key"
        }
      }
    }
  }
}

API Key 获取方式

API用途获取方式必需
TUSHARE_TOKEN获取财务数据https://tushare.pro (免费注册)
BAIDU_API_KEY百度搜索新闻百度智能云控制台❌ 可选
TAVILY_API_KEY深度分析https://tavily.com❌ 可选

示例

输入

{
  "stock_code": "601117",
  "style": "balanced"
}

输出

{
  "stock": "601117",
  "name": "中国化学",
  "report": "# 📈 中国化学 (601117) 分析报告\n\n...",
  "analysis": "利好因素:\n1. 行业地位领先...\n风险因素:\n1. 行业竞争加剧...",
  "model": "阿里云 Coding Plan(全局自动调用)"
}

Comments

Loading comments...