← 返回 Skills 市场
luaqnyin

A Stock Paper Trade

作者 luaqnyin · GitHub ↗ · v1.0.1 · MIT-0
darwinlinuxwin32 ⚠ suspicious
564
总下载
0
收藏
2
当前安装
2
版本数
在 OpenClaw 中安装
/install a-stock-paper-trade
功能描述
A股模拟炒股系统。当用户需要模拟炒股、查询行情、买卖下单、查看持仓盈亏时触发。支持实时行情、买卖下单、持仓管理、盈亏计算、涨跌排行。关键词:炒股、买入、卖出、持仓、盈亏、行情、涨停、跌停、选股、大盘。
使用说明 (SKILL.md)

优化日期: 2026-04-02

A股模拟炒股

本地纸面交易系统,基于 akshare 实时行情。无需任何外部账号,纯模拟。

快速开始

# 初始化账户(100万虚拟资金)
source ~/.agent-reach-venv/bin/activate
python3 {baseDir}/scripts/trader.py init

# 查大盘
python3 {baseDir}/scripts/trader.py quote --all

# 查个股行情
python3 {baseDir}/scripts/trader.py quote 600519 000001

# 搜索股票
python3 {baseDir}/scripts/trader.py search 茅台

# 买入(1手=100股,市价)
python3 {baseDir}/scripts/trader.py buy 600519 1

# 买入(指定价格)
python3 {baseDir}/scripts/trader.py buy 600519 2 --price 1700

# 卖出
python3 {baseDir}/scripts/trader.py sell 600519 1

# 查持仓
python3 {baseDir}/scripts/trader.py positions

# 账户总览
python3 {baseDir}/scripts/trader.py balance

# 交易记录
python3 {baseDir}/scripts/trader.py history --limit 10

# K线
python3 {baseDir}/scripts/trader.py kline 600519 --days 60

# 涨幅TOP10
python3 {baseDir}/scripts/trader.py rank --top 10

# 跌幅TOP10
python3 {baseDir}/scripts/trader.py rank --bottom --top 10

交易规则

  • 最小单位:1手 = 100股
  • 佣金:万三(最低5元)
  • 印花税:千一(仅卖出)
  • 不支持涨跌停价格下单(但当前版本未强制校验,agent 应自行判断)
  • 数据来源:东方财富(akshare),仅交易时间内有效

费用计算

费用 买入 卖出
佣金 万三(最低5元) 万三(最低5元)
印花税 千一
过户费 忽略(模拟简化)

数据存储

  • 位置:~/.openclaw/paper-trade/portfolio.json
  • 重置:python3 {baseDir}/scripts/trader.py init --reset

注意

  • 行情数据来自 akshare,依赖网络(不需要代理,东方财富国内直连)
  • 非 A 股交易时间行情可能不准确
  • 所有操作输出 JSON,方便 agent 解析
安全使用建议
This skill appears to implement a local A-share paper trading tool and does not request credentials, but I found several practical and safety issues you should consider before running it: - Dependency gap: The script imports requests and akshare but the skill declares only python3. Install those packages in an isolated virtualenv yourself (pip install requests akshare) rather than running arbitrary installer steps. Avoid running as root. - Inconsistent docs vs code: SKILL.md Quick Start says initializing with 1,000,000 virtual funds, but the code sets INITIAL_CASH = 50,000. Decide which is correct and update before trusting balances. - Bug / truncated code: The provided script ends mid-function (cmd_sell) and contains at least one apparent bug (uses 'receive' vs 'received' / 'received' variable), which will cause runtime errors and possibly incorrect accounting. Obtain and review the complete, fixed source before use. - Network calls: The script fetches live data from sina (HTTP) and uses akshare. That requires network access and will contact external servers. If you need strict privacy, do not run it on sensitive networks. - Run safely: Execute only in an isolated environment (dedicated venv or container) after auditing/fixing the sell logic and reconciling initial cash. Inspect full file contents locally; do not blindly pip/install packages from unknown sources. If you want, I can: (1) point out the exact lines with bugs and suggest fixes, (2) produce a requirements.txt and a safe run checklist, or (3) attempt to statically repair the truncated sell function based on typical logic.
功能分析
Type: OpenClaw Skill Name: a-stock-paper-trade Version: 1.0.1 The skill is a legitimate local A-share paper trading simulator. It uses the 'akshare' library and Sina Finance's public API to fetch real-time market data and manages a virtual portfolio stored locally in the user's home directory (~/.openclaw/paper-trade/portfolio.json). Analysis of scripts/trader.py and SKILL.md shows no evidence of data exfiltration, command injection, or malicious intent; all network and file operations are strictly aligned with the stated purpose of stock trading simulation.
能力评估
Purpose & Capability
Name/description (A股纸面交易) aligns with the included code: it implements quote/kline/buy/sell/positions and stores a local portfolio. However SKILL.md claims 1,000,000 initial virtual funds in the Quick Start, while the code sets INITIAL_CASH = 50,000 (5万). The SKILL.md also mentions akshare but the skill only declares python3 as a required binary and provides no install steps for Python packages (requests, akshare) the script imports.
Instruction Scope
SKILL.md instructs activating a specific virtualenv path (~/.agent-reach-venv/bin/activate) which is environment-specific and not justified; it assumes network access (ok for market data) and reads/writes a local file at ~/.openclaw/paper-trade/portfolio.json (expected). The instructions and script only fetch market data from public endpoints (sina, akshare) — no other external endpoints — but the instruction set does not declare or install the Python dependencies it uses.
Install Mechanism
No install spec is provided (instruction-only install), yet the script depends on third‑party Python packages (requests, akshare). Because there is no guidance to install these, a user/agent might fail to run it or attempt to pip install arbitrary packages at runtime. There is no download of code from untrusted URLs in the package itself (script is included), so install risk is moderate due to missing dependency management rather than a hostile installer.
Credentials
The skill requests no environment variables or external credentials and only writes a portfolio file under the user's home (~/.openclaw/paper-trade/portfolio.json). That storage and the network calls to fetch public market data are proportionate to the stated purpose.
Persistence & Privilege
always is false and the skill does not request elevated privileges or modify other skills. It persists only its own portfolio JSON under the user's home, which is consistent with a paper trading tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install a-stock-paper-trade
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /a-stock-paper-trade 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Improved SKILL.md description for clearer skill triggers and supported commands. - Updated trigger wording to help users know when the skill will activate. - No functionality changes; documentation only.
v1.0.0
a-stock-paper-trade v1.0.0 - First release: local A股 (China A-shares) paper trading system. - Supports real-time market quotes, stock search, buy/sell orders, position management, profit/loss calculation, rankings, and K-line data. - Virtual portfolio; no external accounts needed, data stored locally. - All operations emit JSON output for easy integration and parsing. - Uses akshare for data, with simplified fee rules and no support for non-trading periods.
元数据
Slug a-stock-paper-trade
版本 1.0.1
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 2
常见问题

A Stock Paper Trade 是什么?

A股模拟炒股系统。当用户需要模拟炒股、查询行情、买卖下单、查看持仓盈亏时触发。支持实时行情、买卖下单、持仓管理、盈亏计算、涨跌排行。关键词:炒股、买入、卖出、持仓、盈亏、行情、涨停、跌停、选股、大盘。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 564 次。

如何安装 A Stock Paper Trade?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install a-stock-paper-trade」即可一键安装,无需额外配置。

A Stock Paper Trade 是免费的吗?

是的,A Stock Paper Trade 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

A Stock Paper Trade 支持哪些平台?

A Stock Paper Trade 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin, linux, win32)。

谁开发了 A Stock Paper Trade?

由 luaqnyin(@luaqnyin)开发并维护,当前版本 v1.0.1。

💬 留言讨论