← Back to Skills Marketplace
luaqnyin

A Stock Paper Trade

by luaqnyin · GitHub ↗ · v1.0.1 · MIT-0
darwinlinuxwin32 ⚠ suspicious
564
Downloads
0
Stars
2
Active Installs
2
Versions
Install in OpenClaw
/install a-stock-paper-trade
Description
A股模拟炒股系统。当用户需要模拟炒股、查询行情、买卖下单、查看持仓盈亏时触发。支持实时行情、买卖下单、持仓管理、盈亏计算、涨跌排行。关键词:炒股、买入、卖出、持仓、盈亏、行情、涨停、跌停、选股、大盘。
README (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 解析
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install a-stock-paper-trade
  3. After installation, invoke the skill by name or use /a-stock-paper-trade
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug a-stock-paper-trade
Version 1.0.1
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 2
Frequently Asked Questions

What is A Stock Paper Trade?

A股模拟炒股系统。当用户需要模拟炒股、查询行情、买卖下单、查看持仓盈亏时触发。支持实时行情、买卖下单、持仓管理、盈亏计算、涨跌排行。关键词:炒股、买入、卖出、持仓、盈亏、行情、涨停、跌停、选股、大盘。 It is an AI Agent Skill for Claude Code / OpenClaw, with 564 downloads so far.

How do I install A Stock Paper Trade?

Run "/install a-stock-paper-trade" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is A Stock Paper Trade free?

Yes, A Stock Paper Trade is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does A Stock Paper Trade support?

A Stock Paper Trade is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux, win32).

Who created A Stock Paper Trade?

It is built and maintained by luaqnyin (@luaqnyin); the current version is v1.0.1.

💬 Comments