Agent skill

A Share Paper Trading

by shouldnotappearcalm in shouldnotappearcalm/a-share-skill

A股模拟盘交易与回测技能。Use when 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测。

MITAuto-check passedBusiness, Finance & HR

Install A Share Paper Trading

skills CLI
$ npx skills add shouldnotappearcalm/a-share-skill --skill a-share-paper-trading -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shouldnotappearcalm/a-share-skill a-share-paper-trading --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shouldnotappearcalm/a-share-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/a-share-paper-trading .claude/skills/a-share-paper-trading && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
a-share-paper-trading
GitHub stars
243
Token cost
~1.4k tokens
SKILL.md length
260 words
Files
15 (incl. scripts)
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

A股模拟盘交易与回测技能。Use when 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测。

  • Works in 3 steps: 先确认账户路由:show-default-account 或… → 再确认资金:show-account 。 → 下单前确认持仓与未完成单:positions 与 orders --status…
  • 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测
  • SKILL.md covers 何时使用, 启动, CLI and Agent 执行规则(账户路由), plus 8 more sections
  • Runs Python scripts from its folder; calls python3

What it does

A Share Paper Trading is an agent skill from shouldnotappearcalm/a-share-skill. A股模拟盘交易与回测技能。Use when 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测。

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files, including scripts (for example `README.md`, `scripts/backtest_batch_validation.py` and `scripts/full_function_smoke_check.py`).

It sits in Business, Finance & HR, covering Trading and backtesting. The repository describes itself as: A股数据分析、量化选股与模拟交易 Skill 集合,支持实时行情、历史K线、技术指标、自定义交易策略与模拟买入、卖出交易账户. The licence is MIT.

When your agent uses it

  • 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测
  • Tasks that involve Trading and backtesting

Example prompts

  • “/a-share-paper-trading”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 先确认账户路由:show-default-account 或 list-accounts。
  2. 再确认资金:show-account 。
  3. 下单前确认持仓与未完成单:positions 与 orders --status open。

What it can do on your machine

Read from SKILL.md and the folder at commit f145273. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 13 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

A Share Paper Trading loads about 1.4k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 260 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from shouldnotappearcalm/a-share-skill at commit f145273, republished under its MIT licence (© shouldnotappearcalm). 260 words, ~1,380 tokens.

Download SKILL.mdSave it as .claude/skills/a-share-paper-trading/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
a-share-paper-trading
description
A股模拟盘交易与回测技能。Use when 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测。

A股模拟盘

独立的模拟盘 skill。交易服务、CLI、账户、撮合与行情适配都在本目录内,不依赖其他 skill 脚本。

何时使用

  • 启动或检查模拟盘服务
  • 创建/重置账户
  • 限价买卖、市价买卖、撤单
  • 查询账户、持仓、订单、成交
  • 验证涨跌停、T+1、收盘过期
  • 跑简单回测

启动

bash
SKILL_DIR="<本skill绝对路径>"
python3 "$SKILL_DIR/scripts/paper_trading_service.py" --host 127.0.0.1 --port 18765

默认监听 http://127.0.0.1:18765,默认数据库不再落在 skill 目录,而是落到用户级数据目录:

  • macOS: ~/Library/Application Support/a-share-paper-trading/paper_trading.db
  • Linux: ${XDG_DATA_HOME:-~/.local/share}/a-share-paper-trading/paper_trading.db

若本机该端口已有模拟盘进程在跑,不要再启动第二个实例:会报 Address already in use,且多进程可能争用同一 SQLite 库文件。启动前可先检查端口是否在监听,例如:

bash
lsof -iTCP:18765 -sTCP:LISTEN

或向 http://127.0.0.1:18765/accounts 发 GET(CLI 默认 --base-url 与此一致)。已有服务时直接用 paper_trade_cli.py 即可。

更推荐使用控制脚本常驻运行:

bash
python3 "$SKILL_DIR/scripts/paper_trading_ctl.py" start
python3 "$SKILL_DIR/scripts/paper_trading_ctl.py" status
python3 "$SKILL_DIR/scripts/paper_trading_ctl.py" stop

在 macOS 上,如需持续自启动,可安装 launchd:

bash
python3 "$SKILL_DIR/scripts/paper_trading_ctl.py" install-launchd

服务会:

  • 交易时段定时撮合挂单
  • 非交易时段停止撮合
  • 收盘后让当日未成单过期
  • 定时写账户净值快照

可用启动参数:

  • --host
  • --port
  • --db-path
  • --match-interval
  • --valuation-interval
  • --idle-valuation-interval

默认端口与 CLI 基址已改为 18765,避免和常见本地开发服务冲突。

CLI

bash
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" create-account alpha --cash 500000
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" list-accounts
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" show-default-account
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" set-default-account alpha
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" reset-account alpha --cash 300000
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" add-cash alpha 50000 --note 入金
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" deduct-cash alpha 10000 --note 出金
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" buy alpha 600519 100 --market
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" sell alpha 600519 100 --price 1450
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" orders alpha
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" positions alpha
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" show-account alpha
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" trades alpha
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" cancel <order_id>
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" process-orders
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" run-snapshots
python3 "$SKILL_DIR/scripts/paper_trade_cli.py" backtest 600519 --strategy sma_cross --start 2025-01-01 --end 2026-03-31 --cash 200000

支持的 CLI 子命令:

  • create-account
  • show-default-account
  • set-default-account
  • reset-account
  • list-accounts
  • show-account
  • positions
  • orders
  • trades
  • buy
  • sell
  • cancel
  • add-cash
  • deduct-cash
  • process-orders
  • run-snapshots
  • backtest

Agent 执行规则(账户路由)

  • 首次创建模拟账户前,必须先向用户确认初始资金金额。
  • 若系统存在多个账户且用户未指明账户,先反问“本次操作哪个账户”再继续。
  • 若仅有一个账户且该账户已存在,默认直接使用该账户。
  • 若存在默认账户(show-default-account 可查),且用户未指定账户,优先使用默认账户。
  • 需要切换默认账户时,使用 set-default-account。
首次初始化资金规则(默认 100w)
  • 当用户首次要进行交易但尚未初始化账户资金时,先反问确认,不直接执行。
  • 默认建议初始资金为 1000000(100w),提问模板建议为:
    • “当前未初始化模拟账户,默认按 100w 启动,是否确认?如需修改请直接给出金额。”
  • 仅在用户明确确认后,才执行创建默认账户。
  • 若用户给出其他金额,按用户金额创建并继续后续操作。

CLI 参数约束(Agent 必读)

  • buy/sell:
    • 限价单必须带 --price。
    • 市价单使用 --market,不应再传 --price。
  • orders --status 可用值:open / filled / cancelled / expired / rejected。
  • add-cash / deduct-cash 的 amount 必须为正数,单位为人民币元。
  • 默认优先使用 --json 输出,便于后续结构化解析与决策。

执行前检查(下单前固定三步)

  1. 先确认账户路由:show-default-account 或 list-accounts。
  2. 再确认资金:show-account <account_id>。
  3. 下单前确认持仓与未完成单:positions <account_id> 与 orders <account_id> --status open。

资金调整规则(加减可用资金)

  • 入金使用 add-cash <account_id> <amount>,出金使用 deduct-cash <account_id> <amount>。
  • 入金/出金金额必须为正数。
  • 出金只能减少可用资金,不得穿透冻结资金;可用不足时应先告知用户再调整。

常见错误与处理动作

  • Address already in use:不要重复启动服务,直接使用现有服务地址。
  • default account not set:触发首次初始化反问流程,确认金额后创建默认账户。
  • insufficient available cash:提示当前可用资金,建议入金或降低下单数量/价格。
  • insufficient sellable qty:提示可卖数量,说明可能受 T+1 影响或持仓不足。
  • order is not open:先查询订单状态(可能已成交/已撤/已过期),再决定下一步。
  • market orders are only accepted during trading hours:改用限价单或等待交易时段。

规则摘要

  • 只支持 A 股 long-only
  • 买入数量必须是 100 股整数倍
  • 卖出遵守 T+1
  • 限价单价格必须符合 0.01 元最小报价单位
  • 板块涨跌幅兜底规则:
    • 主板普通股 10%
    • 创业板/科创板 20%
    • 主板 ST 5%
  • 限价单价格不能超出当日涨跌停
  • 触及涨停价默认买不进(包含一字涨停)
  • 触及跌停价默认卖不出(包含一字跌停)
  • 市价单仅在连续竞价时段接受
  • 集合竞价与午休时段不做自动撮合
  • 行情时间戳不是当日时,视为陈旧行情,不执行市价成交
  • 费用模型包含最低佣金、卖出印花税、沪市过户费
  • 当日单收盘后过期

结构

  • scripts/paper_trading_service.py: 启动 HTTP 服务
  • scripts/paper_trade_cli.py: CLI
  • scripts/paper_trading_ctl.py: 启停、状态、launchd 安装
  • scripts/paper_trading_runtime.py: 运行时默认目录、端口、路径
  • scripts/paper_trading/: 账户、撮合、估值、数据适配

服务接口

默认暴露这些 HTTP 路由:

  • GET /accounts
  • GET /accounts/default
  • POST /accounts
  • POST /accounts/default
  • GET /accounts/{account_id}
  • POST /accounts/{account_id}/reset
  • POST /accounts/{account_id}/cash-adjust
  • GET /accounts/{account_id}/positions
  • GET /accounts/{account_id}/orders
  • GET /accounts/{account_id}/trades
  • POST /orders
  • POST /orders/{order_id}/cancel
  • POST /orders/process
  • POST /snapshots/run
  • POST /backtest
  • GET /health

参考

© shouldnotappearcalm, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files (scripts) in a-share-paper-trading of shouldnotappearcalm/a-share-skill.

  • SKILL.md
  • README.md
  • scripts/backtest_batch_validation.py
  • scripts/full_function_smoke_check.py
  • scripts/paper_trade_cli.py
  • scripts/paper_trading/__init__.py
  • scripts/paper_trading/engine.py
  • scripts/paper_trading/market_data.py
  • scripts/paper_trading/service.py
  • scripts/paper_trading_ctl.py
  • scripts/paper_trading_runtime.py
  • scripts/paper_trading_service.py
  • scripts/real_stock_rule_validation.py
  • scripts/rule_regression_check.py
  • scripts/test_market_data_intraday_snapshot.py

Open the folder on GitHubat commit f145273

Compare with similar skills

A Share Paper Trading next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

A Share Paper Trading compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
A Share Paper Trading this skillshouldnotappearcalm/a-share-skill243—~1.4kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3222 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle878—~5.9kAutomated safety check: PassMIT
Polyclawchainstacklabs/polyclaw3591 repos~2kAutomated safety check: PassApache-2.0
Markdownfacioquo/stock-indicators-dotnet1.2k—~812Automated safety check: PassApache-2.0

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    322 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    atilaahmettaner/tradingview-mcp

    AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…

    5k GitHub stars~1.3k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    878 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Polyclaw

    chainstacklabs/polyclaw

    Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

    359 GitHub starsUsed in 1 repo~2k tokens
    Business, Finance & HRAuto-check passed
  • Markdown

    facioquo/stock-indicators-dotnet

    Format and lint Markdown in this repository against GitHub Flavored Markdown and its markdownlint-cli2 configuration — headers, lists, code fences, callouts (VitePress containers on docs-site pages…

    1.2k GitHub stars~812 tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Openmobius Skill

    MobiusQuant/OpenMobius-skill

    Provides multi-school trading Q&A, chart/OHLCV analysis, annotation, and fresh-market workflows covering ICT/SMC, ChanLun, Wyckoff, Price Action, Order Flow, VSA, and Elliott Wave.

    697 GitHub stars~7.2k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed

More from shouldnotappearcalm/a-share-skill

  • A Share Strategy Allmarket Multi Swing Defensive

    shouldnotappearcalm/a-share-skill

    A 股全市场高流动性池内按趋势回踩(trendpullback)产出买入候选与持仓卖出信号;另有 realtimequotes 批量拉取现价快照。供下单前决策;不跑回测、不自动下单。Use when 用户要选股、看实时报价、判断买卖信号或检查持仓是否触发离场条件。

    243 GitHub stars~907 tokensUpdated today
    Auto-check passed
  • A Share Strategy Mainboard Multi Swing Defensive

    shouldnotappearcalm/a-share-skill

    A 股主板流动性池内按趋势回踩(trendpullback)产出买入候选与持仓卖出信号;另有 realtimequotes 批量拉取现价快照。供下单前决策;不跑回测、不自动下单。Use when 用户要选股、看实时报价、判断买卖信号或检查持仓是否触发离场条件。

    243 GitHub stars~903 tokensUpdated today
    Auto-check passed
  • A Share Data

    shouldnotappearcalm/a-share-skill

    查询A股行情、历史K线与复权、财务指标、公司新闻公告、行业分类与成分、板块热力图、指数、宏观及A+H上市信息。用于股票数据查询、原始数据测试和数据源异常排查。

    243 GitHub stars~896 tokensUpdated today
    Auto-check passed
  • Tuige Shortline Trading

    shouldnotappearcalm/a-share-skill

    基于退哥短线交易规则的A股场景化决策技能。Use when 用户要按交易场景查看短线规则、做选股、判断趋势回踩、涨停回调、连板接力、洗盘结束、卖出失效或仓位纪律。

    243 GitHub stars~687 tokensUpdated today
    Auto-check passed
  • Macd Second Golden Cross

    shouldnotappearcalm/a-share-skill

    A股“MACD底背离 + 零轴下二次金叉”实战分析与交易执行技能。用于把用户的盘感描述转成可执行的三档决策(上观察名单/可试错出手/必须放弃)、盘中检查单、入场与风控规则。适用于用户提到“二次金叉”“水下二次金叉”“底背离”“第一脚第二脚”“回踩验底”“MACD背离”“抄底修复”“想做但怕假信号”等场景。

    243 GitHub stars~528 tokensUpdated today
    Auto-check passed
  • Macd Trend Resonance Stock Picker

    shouldnotappearcalm/a-share-skill

    基于“均线定方向,MACD定节奏”的A股选股与交易计划技能。Use when 用户要求把均线与MACD结合做选股、筛票、盘前候选池、趋势跟随、回踩再上、金叉确认、顶背离减仓、或希望把技术判断沉淀成可执行规则与风控模板。

    243 GitHub stars~668 tokensUpdated today
    Auto-check passed

Questions about A Share Paper Trading

What does A Share Paper Trading do?

A股模拟盘交易与回测技能。Use when 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测。. A Share Paper Trading is an agent skill from shouldnotappearcalm/a-share-skill.

When should I use A Share Paper Trading?

A Share Paper Trading fits situations like: 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测; tasks that involve Trading and backtesting.

How do I install A Share Paper Trading in Claude Code?

Run `npx skills add shouldnotappearcalm/a-share-skill --skill a-share-paper-trading -a claude-code`. Or copy the skill folder (a-share-paper-trading in shouldnotappearcalm/a-share-skill) into .claude/skills/a-share-paper-trading in your project. Claude Code loads it when a task matches its description.

How do I install A Share Paper Trading in Codex?

Run `npx skills add shouldnotappearcalm/a-share-skill --skill a-share-paper-trading -a codex`. Or copy the skill folder (a-share-paper-trading in shouldnotappearcalm/a-share-skill) into .agents/skills/a-share-paper-trading in your project. Codex loads it when a task matches its description.

Can I use A Share Paper Trading in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shouldnotappearcalm/a-share-skill --skill a-share-paper-trading -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/a-share-paper-trading, .gemini/skills/a-share-paper-trading, .github/skills/a-share-paper-trading and .opencode/skills/a-share-paper-trading in your project.

What does A Share Paper Trading need to run?

Going by SKILL.md and its folder, A Share Paper Trading needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does A Share Paper Trading access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is A Share Paper Trading safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does A Share Paper Trading use?

A Share Paper Trading is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does A Share Paper Trading use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to A Share Paper Trading?

Skills that share tags, products or a category with A Share Paper Trading: Tushare Data (zillionare/zillionare, 322 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 878 stars) and Polyclaw (chainstacklabs/polyclaw, 359 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains A Share Paper Trading?

shouldnotappearcalm (a GitHub user) maintains it in shouldnotappearcalm/a-share-skill, which has 243 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 11, 2026.

Source: shouldnotappearcalm/a-share-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.