← 返回
未分类

stock-scheme-tracker

个股投资策略跟踪器——将从分析报告中提取的个股投资策略持久化到一个本地 Markdown 文件,然后定期核对市场行情是否触发了建仓、止损或止盈条件,给出可操作的下一步建议。
个股投资策略跟踪器——将从分析报告中提取的个股投资策略持久化到一个本地 Markdown 文件,然后定期核对市场行情是否触发了建仓、止损或止盈条件,给出可操作的下一步建议。
DC
未分类 community v1.1.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 142
下载
💾 1
安装
2
版本
#latest

概述

Stock Scheme Tracker 📈

个股投资策略跟踪器——将从分析报告中提取的个股投资策略持久化到一个本地 Markdown 文件,然后定期核对市场行情是否触发了建仓、止损或止盈条件,给出可操作的下一步建议。

两种模式:

  • 保存模式(Save):完成任意个股分析后(DCF 估值、巴菲特框架、技术分析等),自动从分析文本中提取建仓条件、止损线、目标价、退出信号、核心假设等关键字段,格式化后追加到策略跟踪文件。如果该股票已存在则更新而非重复添加。触发词:保存策略跟踪这个票记录建仓条件
  • 核对模式(Check):读取策略跟踪文件中所有已保存的策略,获取每只股票的最新行情数据(价格、PE 等),逐条比对建仓条件是否已触发(✅ 已触发 / ❌ 未触发 / ⚠️ 接近触发),检查退出信号是否出现,输出清晰的汇总表格和每只股票的具体操作建议。触发词:检查策略核对建仓条件看看哪些票可以买

兼容 OpenClaw / WorkBuddy / Claude Code 等 AI Agent 工具。仅需 Python 3 运行时,通过 STOCK_SCHEME_PATH 环境变量指定策略文件路径,脚本不做任何网络请求,核对模式的行情数据由 Agent 通过其金融数据工具或网络搜索获取。


Save per-stock investment strategies extracted from analysis reports into a persistent tracking file, then periodically check if market conditions have triggered any entry, stop-loss, or take-profit conditions. Provide actionable next-step recommendations.


Quick Start

Install

Copy the skill directory to your agent's skills folder:

# OpenClaw
cp -r stock-scheme-tracker ~/.openclaw/skills/

# WorkBuddy
cp -r stock-scheme-tracker ~/.workbuddy/skills/

# Claude Code (project-level)
cp -r stock-scheme-tracker .claude/skills/

Configure

Set the environment variable to point to your tracking file:

# Add to your shell profile (~/.zshrc, ~/.bashrc, etc.)
export STOCK_SCHEME_PATH="$HOME/Documents/stock/scheme.md"

Or configure via your agent's config:

// OpenClaw: ~/.openclaw/openclaw.json
{
  "skills": {
    "entries": {
      "stock-scheme-tracker": {
        "env": {
          "STOCK_SCHEME_PATH": "~/Documents/stock/scheme.md"
        }
      }
    }
  }
}

If STOCK_SCHEME_PATH is not set, the skill defaults to ~/Documents/stock/scheme.md.

Verify

echo $STOCK_SCHEME_PATH
# Should output your configured path

Workflow Decision Tree

  1. Determine mode: Did the user just complete an analysis (→ save mode), or do they want to review existing strategies (→ check mode)?
  2. Save mode: Extract strategy elements from the analysis, format them, and append to the scheme file.
  3. Check mode: Read all strategies from the scheme file, fetch latest market data for each stock, evaluate every condition, and output a summary with next-step recommendations.

Save Mode

When to Use

  • Immediately after completing any stock investment analysis (e.g., DCF valuation, Buffett framework, technical analysis, or any investment report).
  • The user says "保存策略", "把策略记下来", "跟踪这个票", "save strategy", "track this stock", or any variant.

Extraction Rules

From the analysis text, extract these fields. If a field is not mentioned, mark it as "未明确" rather than fabricating.

FieldDescriptionExample
-----------------------------
stock_codeStock code688XXX
stock_nameStock nameXX办公
analysis_dateAnalysis date2026-04-22
recommendationCore recommendation建议观察,等待更好入场时机
entry_conditionsEntry conditions (price/valuation/events)PE≤45-50;股价180-200元
stop_lossStop-loss condition跌破前期低点或技术位
target_priceTarget price / take-profit range机构目标价400元
exit_signalsExit signals (assumption invalidation)月活环比下滑;市场份额跌破80%
position_sizeSuggested position size轻仓试探
time_horizonHolding period3年
key_assumptionsKey assumptionsAI商业化持续推进
open_questionsOpen questionsXX AI付费转化率是多少
current_pricePrice at analysis~250元
current_pePE at analysis62.46
market_capMarket cap at analysis1147亿

Output Format

Append a new section to the scheme file (path from STOCK_SCHEME_PATH env var) using the exact format defined in references/scheme_format.md. Use Markdown table for entry conditions so they can be machine-parsed later.

Important

  • If the stock already exists in the scheme file, update the existing section rather than duplicating it. Preserve historical entries by appending a date-stamped update note.
  • After saving, briefly confirm to the user what was saved.

Check Mode

When to Use

  • User says "检查策略", "核对建仓条件", "看看哪些票可以买", "策略跟踪", "check strategy", or any variant.
  • Can be invoked standalone without any prior analysis.

Steps

  1. Read the scheme file (path from STOCK_SCHEME_PATH env var).
  2. For each tracked stock, fetch the latest market data (price, PE, key metrics). Use available financial data tools or web search.
  3. Evaluate each entry_conditions row: compare current value vs target value.
  4. Mark each condition as ✅ 已触发, ❌ 未触发, or ⚠️ 接近触发.
  5. Check if any exit_signals have occurred.
  6. Output a clean summary table and specific next-step recommendations per stock.

Output Format

## 策略核对报告 — 2026-04-23

### XX办公 (688XXX)
| 条件类型 | 目标 | 当前 | 状态 |
|----------|------|------|------|
| PE建仓 | ≤45-50 | 62.46 | ❌ 未触发 |
| 股价建仓 | 180-200 | 250 | ❌ 未触发 |

**建议**: 继续观察,等待PE回落至50以下或股价跌破200再考虑建仓。

Core Tasks

Here are natural-language prompts that trigger this skill:

  • "我刚分析完XX办公,帮我保存策略"
  • "检查一下我跟踪的股票,哪些条件触发了"
  • "核对建仓条件"
  • "跟踪策略"
  • "把刚才的分析结论记录到策略跟踪文件"
  • "I just finished analyzing Apple, save the strategy"
  • "Check all my stock strategies"

Environment Variable Contract

VariablePurposeRequiredSet Via
--------------------------------------
STOCK_SCHEME_PATHPath to the strategy tracking Markdown fileNo (defaults to ~/Documents/stock/scheme.md)Shell profile or agent config

Security & Guardrails

  1. Local file only: Both scripts only read/write a local Markdown file specified by STOCK_SCHEME_PATH. No network calls are made by save_scheme.py or check_scheme.py.
  2. Market data source: During check mode, market data is fetched via the agent's available financial data tools or web search. This involves querying public market quotes (stock codes and metric names only) — no private strategy content or position details are transmitted.
  3. No trading execution: This skill provides analysis and recommendations only. It does NOT execute any trades or connect to brokerage accounts.
  4. No credential collection: This skill only requires STOCK_SCHEME_PATH (a file path). It never asks for API keys, tokens, passwords, or any other credentials.
  5. Data integrity: The save script uses atomic write patterns and preserves historical entries. Existing stock sections are updated in-place rather than overwritten.
  6. Path validation: The scripts validate that STOCK_SCHEME_PATH points to a .md file and will create parent directories if needed.

Troubleshooting

ProblemCauseFix
---------------------
"No such file or directory"STOCK_SCHEME_PATH not set or points to invalid pathSet env var or rely on default ~/Documents/stock/scheme.md
Strategy not found during checkScheme file is empty or format is corruptedVerify the file uses the format in references/scheme_format.md
Duplicate entries for same stockSave mode ran twice without updatingThe script auto-detects duplicates; if using manual edit, follow the update convention
Chinese characters garbled in outputTerminal encoding mismatchEnsure your terminal uses UTF-8 (export LANG=en_US.UTF-8 or zh_CN.UTF-8)

Release Notes

  • 1.1.0 — Fixed metadata consistency (top-level requires/env), added credential collection disclaimer, clarified market data query scope in security section.
  • 1.0.0 — Initial release. Save and check modes with Markdown-based tracking file.

Links

Publisher

  • Publisher: @dc
  • License: MIT-0
  • Source: https://github.com/dcsight/

版本历史

共 2 个版本

  • v1.1.1 更新中文描述 当前
    2026-04-27 16:44 安全 安全
  • v1.0.0 - stock-scheme-tracker 初始发布。 - 将分析报告中提取出的单只股票投资策略,保存至一个 Markdown 格式的跟踪文件中。 - 通过获取最新股票数据、评估预定义条件,并输出可操作的后续建议,来检查/跟踪策略。 - 支持两种模式:保存(追加/更新股票策略)和检查(审阅所有被跟踪的股票)。 - 通过 STOCK_SCHEME_PATH 环境变量进行配置;提供了默认值。 - 所有数据本地存储;在原文件中保留历史策略更新记录。
    2026-04-27 15:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,223 📥 267,466
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 673 📥 325,068
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,073 📥 806,692