Agent skill

Simulation Trading

by qusong0627 in qusong0627/QuantMind

模拟交易 — 下单买卖、持仓管理、成交查询、账户状态、资金快照。在 QuantBot / Claude Code 中执行模拟交易、下单、查询持仓、查看账户、管理交易记录时使用。触发词:模拟交易、模拟下单、买入股票、卖出股票、查持仓、查账户、模拟账户、模拟交易记录、模拟撤单

AGPL-3.0Auto-check passedBusiness, Finance & HR

Install Simulation Trading

skills CLI
$ npx skills add qusong0627/QuantMind --skill simulation-trading -a claude-code

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

GitHub CLI
$ gh skill install qusong0627/QuantMind simulation-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/qusong0627/QuantMind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/simulation-trading .claude/skills/simulation-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
simulation-trading
GitHub stars
1.7k
Token cost
~1.6k tokens
SKILL.md length
179 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
AGPL-3.0

At a glance

模拟交易 — 下单买卖、持仓管理、成交查询、账户状态、资金快照。在 QuantBot / Claude Code 中执行模拟交易、下单、查询持仓、查看账户、管理交易记录时使用。触发词:模拟交易、模拟下单、买入股票、卖出股票、查持仓、查账户、模拟账户、模拟交易记录、模拟撤单

  • Works in 7 steps: 账户状态 → 下单(核心) → 订单与成交查询 → …
  • Tasks that involve Trading and backtesting
  • SKILL.md covers 实盘 / 模拟盘切换, 认证, 1. 账户状态 and 2. 下单(核心), plus 5 more sections
  • Calls curl and python3

What it does

Simulation Trading is an agent skill from qusong0627/QuantMind. 模拟交易 — 下单买卖、持仓管理、成交查询、账户状态、资金快照。在 QuantBot / Claude Code 中执行模拟交易、下单、查询持仓、查看账户、管理交易记录时使用。触发词:模拟交易、模拟下单、买入股票、卖出股票、查持仓、查账户、模拟账户、模拟交易记录、模拟撤单

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR, covering Trading and backtesting. The repository describes itself as: QuantMind(量化大脑)开源版是一款面向个人开发者与投研团队的 AI 原生多市场量化交易平台。深度集成微软 Qlib、RD-Agent 因子演化与 QuantBot全能工作台,提供从 300+ 维因子挖掘、13 种机器学习与深度学习模型工场、Qlib 高性能回测、截面批量推理、7x24… The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Trading and backtesting

Example prompts

  • “/simulation-trading”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. 账户状态
  2. 下单(核心)
  3. 订单与成交查询
  4. 模拟盘启动(real-trading)
  5. 实战流程(推荐)
  6. 相关技能
  7. 常见问题

What it can do on your machine

Read from SKILL.md and the folder at commit 2e93d9a. 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

    Shell commands in SKILL.md call:

    • curl
    • python3

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

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    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

Simulation Trading loads about 1.6k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 179 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from qusong0627/QuantMind at commit 2e93d9a, republished under its AGPL-3.0 licence (© qusong0627). 179 words, ~1,602 tokens.

Download SKILL.mdSave it as .claude/skills/simulation-trading/SKILL.md (or your agent's skills folder).
name
simulation-trading
description
模拟交易 — 下单买卖、持仓管理、成交查询、账户状态、资金快照。在 QuantBot / Claude Code 中执行模拟交易、下单、查询持仓、查看账户、管理交易记录时使用。触发词:模拟交易、模拟下单、买入股票、卖出股票、查持仓、查账户、模拟账户、模拟交易记录、模拟撤单

⚙️ 本技能遵循公共运行环境契约(最高优先级,先于本文其余内容执行): 详见 _shared/env-contract.md,执行前先读它。

模拟交易技能

QuantMind 模拟交易(纸面交易)完整操作:下单、持仓、成交、账户、资金快照、模拟盘启动。默认模拟资金 100 万,不影响实盘。

实盘 / 模拟盘切换

  • 前端切换:顶部 HeaderBar 右上角 REAL/SIM 拨动开关,切换实盘(通达信桥)与模拟盘。选择持久化到 localStorage['qm:trading_mode_pref'],默认模拟盘(simulation)。
  • 后端分流:账户按 GET /api/v1/real-trading/status 返回的 mode + 前端分流——SIMULATION 调 /simulation/account,REAL 调 /account。
  • 启动参数:POST /api/v1/real-trading/start 接收 trading_mode=SIMULATION/REAL;实盘需 ENABLE_REAL_TRADING=true 环境变量。
  • 交易就绪检查:/api/v1/real-trading/trading-precheck 返回信号就绪/交易权限(可交易/观察态/阻断)。
bash
# 检查交易就绪(启动前必查)
curl -s -H "$AUTH" "$BASE/api/v1/real-trading/trading-precheck"
# 返回: {passed, items:[{key,passed,detail}], signal_readiness, trading_permission}

认证

bash
BASE=http://127.0.0.1:8000
TOKEN=$(curl -s -X POST $BASE/api/v1/auth/login -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin123","tenant_id":"default"}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin).get('access_token',''))")
AUTH="Authorization: Bearer $TOKEN"
CT="Content-Type: application/json"

1. 账户状态

1.1 查看模拟账户
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/account"
# 返回: {cash, total_asset, market_value, positions, initial_equity, ...}
# 默认现金 100 万,positions 为当前持仓
1.2 模拟交易设置
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/settings"
1.3 重置模拟账户
bash
curl -s -X POST -H "$AUTH" "$BASE/api/v1/simulation/reset"
1.4 资金快照
bash
# 手动捕获资金快照
curl -s -X POST -H "$AUTH" "$BASE/api/v1/simulation/snapshots/capture"
# 每日资金快照(总资产/现金/市值序列)
curl -s -H "$AUTH" "$BASE/api/v1/simulation/snapshots/daily"

2. 下单(核心)

2.1 买入/卖出
bash
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/simulation/orders" \
  -d '{
    "symbol": "600519.SH",
    "side": "buy",            # buy / sell
    "order_type": "market",   # market / limit
    "quantity": 100,
    "price": null,            # 限价单必填,市价单可空
    "remarks": "AI策略买入"
  }'

参数:

字段说明
symbol股票代码(600519.SH / SH600519)
sidebuy / sell
order_typemarket(市价)/ limit(限价)
quantity数量(股)
price限价单必填,市价单可空
remarks备注(可选)

返回:order_id + 订单状态(pending/filled/...)

2.2 撤单
bash
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/simulation/orders/{order_id}/cancel" \
  -d '{"reason":"手动撤单"}'

3. 订单与成交查询

3.1 订单列表
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/orders"
# 返回: [{order_id, symbol, side, order_type, quantity, status, ...}]
3.2 单笔订单
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/orders/{order_id}"
3.3 成交记录
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/trades"
# 返回: [{trade_id, symbol, side, quantity, price, ...}]
3.4 单笔成交
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/trades/{trade_id}"
3.5 成交统计
bash
curl -s -H "$AUTH" "$BASE/api/v1/simulation/trades/stats/summary"
# 返回: 盈亏/胜率/交易次数等统计

4. 模拟盘启动(real-trading)

模拟盘生命周期:策略绑定 → 预检查 → 启动 → 持仓跟踪 → 停止。

bash
# 策略绑定到组合(策略信号 → 下单)
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/portfolios/{portfolio_id}/bind-strategy" \
  -d '{"strategy_id":"strategy_xxx","model_id":"mdl_cn_xxx"}'

# 交易预检查(信号就绪 / 资金 / 风控)
curl -s -H "$AUTH" "$BASE/api/v1/real-trading/trading-precheck"

# 启动模拟盘
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/real-trading/start" \
  -d '{"portfolio_id":"xxx","strategy_id":"strategy_xxx"}'
# 停止模拟盘
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/real-trading/stop"

# 运行状态 / 日志 / 订单 / 历史
curl -s -H "$AUTH" "$BASE/api/v1/real-trading/status"
curl -s -H "$AUTH" "$BASE/api/v1/real-trading/logs"
curl -s -H "$AUTH" "$BASE/api/v1/real-trading/orders"
curl -s -H "$AUTH" "$BASE/api/v1/real-trading/history"

组合(Portfolio)管理:

bash
# 创建/列表组合
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/portfolios" -d '{"name":"我的组合","initial_capital":1000000}'
curl -s -H "$AUTH" "$BASE/api/v1/portfolios"
# 组合详情/绩效(分布只有全量口径,见持仓管理节)
curl -s -H "$AUTH" "$BASE/api/v1/portfolios/{id}"
curl -s -H "$AUTH" "$BASE/api/v1/portfolios/{id}/performance"
# 结算/快照/同步
curl -s -X POST -H "$AUTH" "$BASE/api/v1/portfolios/{id}/settlement"
curl -s -X POST -H "$AUTH" "$BASE/api/v1/portfolios/{id}/snapshot"
curl -s -X POST -H "$AUTH" "$BASE/api/v1/portfolios/{id}/sync-status"

持仓管理:

bash
# 组合持仓
curl -s -H "$AUTH" "$BASE/api/v1/portfolios/{id}/positions"
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/portfolios/{id}/positions" -d '{"symbol":"600519.SH","quantity":100}'
# 调整/清仓(注意是 positions/{position_id} 口径,不是 portfolios/{id} 下挂 adjust/close)
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/positions/{position_id}/adjust" -d '{"quantity":100}'
curl -s -X POST -H "$AUTH" -H "$CT" "$BASE/api/v1/positions/{position_id}/close"
curl -s -X PUT -H "$AUTH" -H "$CT" "$BASE/api/v1/positions/{position_id}/price" -d '{"price":1500.0}'
# 全量资产分布(无单组合 distribution,查全量再过滤)
curl -s -H "$AUTH" "$BASE/api/v1/portfolios/distribution"

5. 实战流程(推荐)

当用户要求"模拟交易/买入/卖出"时:

  1. 查账户:/simulation/account 看现金和持仓
  2. 确认标的:查股票当前价(用 [[quantdb-sdk]] 或 K线)
  3. 下单:/simulation/orders POST(市价/限价)
  4. 确认成交:/simulation/orders/{order_id} 查状态
  5. 查看持仓:/simulation/account 看更新后的 positions
  6. 统计:/simulation/trades/stats/summary 看收益

当用户要求"启动模拟盘 / 跑实盘模拟"时:

  1. 建组合:/portfolios POST 创建
  2. 绑定策略:/portfolios/{id}/bind-strategy(strategy_id + model_id)
  3. 预检查:/real-trading/trading-precheck 确认信号就绪
  4. 启动:/real-trading/start
  5. 监控:/real-trading/status + /simulation/account
  6. 停止:/real-trading/stop

6. 相关技能

  • [[stock-market-analysis]] — 分析选哪只股票(371 字段 + 风险评分)
  • [[smart-strategy-stock-picking]] — 条件选股找标的
  • [[quantdb-sdk]] — 查 K 线/估值确定买卖价
  • [[backtest-center]] — 回测验证策略后再模拟执行
  • [[ai-ide-strategy-writing]] — 写策略并执行回测

7. 常见问题

现象处理
买入资金不足查 account cash,减仓或调小 quantity
卖出无持仓查 account positions 确认持有
限价单未成交价格远离现价,改市价或调价
想重置/simulation/reset 恢复 100 万初始资金
模拟盘启动失败查 /real-trading/trading-precheck 看信号就绪状态
策略信号未生成确认模型已推理(见 [[quantmind-operations]])

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

Files

Just SKILL.md in skills/simulation-trading of qusong0627/QuantMind.

Open the folder on GitHubat commit 2e93d9a

Compare with similar skills

Simulation 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.

Simulation Trading compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Simulation Trading this skillqusong0627/QuantMind1.7k—~1.6kAutomated safety check: PassAGPL-3.0
Tushare Datazillionare/zillionare3212 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle875—~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/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 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.

    875 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 today
    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.

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

More from qusong0627/QuantMind

All 27 skills in this repo
  • A-Share Daily Review

    qusong0627/QuantMind

    Produces a post-market review report for the China A-share market from local QuantDB data, news sentiment and model signals, ending in a next-day direction call.

    1.7k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Queries Futu quotes, options, fundamentals and accounts and places orders through the Futu OpenAPI Python SDK, defaulting to simulated trading.

    1.7k GitHub stars~3.3k tokensUpdated today
    Auto-check: notes
  • Turns a plain-language model training request into a validated QuantMind training config file that can be imported from the Model Training page.

    1.7k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Tiger Brokers OpenAPI SDK

    qusong0627/QuantMind

    Covers the Tiger Brokers OpenAPI Python SDK for market data, stock, futures and options trading, push subscriptions, a CLI and an MCP server, defaulting to paper trading.

    1.7k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Tiger Brokers C++ OpenAPI SDK

    qusong0627/QuantMind

    Guides an agent through the Tiger Brokers OpenAPI C++ SDK for build setup, market data, orders and real-time push, defaulting to paper trading.

    1.7k GitHub stars~942 tokensUpdated today
    Auto-check passed
  • Tiger Brokers OpenAPI C# SDK

    qusong0627/QuantMind

    Guides building C# and .NET apps on the Tiger Brokers OpenAPI SDK: setup, market data, orders, accounts, options and real-time push, defaulting to paper trading.

    1.7k GitHub stars~1k tokensUpdated today
    Auto-check passed

Questions about Simulation Trading

What does Simulation Trading do?

模拟交易 — 下单买卖、持仓管理、成交查询、账户状态、资金快照。在 QuantBot / Claude Code 中执行模拟交易、下单、查询持仓、查看账户、管理交易记录时使用。触发词:模拟交易、模拟下单、买入股票、卖出股票、查持仓、查账户、模拟账户、模拟交易记录、模拟撤单. Simulation Trading is an agent skill from qusong0627/QuantMind.

When should I use Simulation Trading?

Simulation Trading fits situations like: tasks that involve Trading and backtesting.

How do I install Simulation Trading in Claude Code?

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

How do I install Simulation Trading in Codex?

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

Can I use Simulation 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 qusong0627/QuantMind --skill simulation-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/simulation-trading, .gemini/skills/simulation-trading, .github/skills/simulation-trading and .opencode/skills/simulation-trading in your project.

What does Simulation Trading need to run?

Going by SKILL.md and its folder, Simulation Trading needs the command-line tools its instructions call (curl and python3). Our summary lists: Python 3.

Does Simulation Trading access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Simulation 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. Review the folder before installing.

What licence does Simulation Trading use?

Simulation Trading is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Simulation Trading use?

About 1.6k tokens (SKILL.md is roughly 6.4k 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 Simulation Trading?

Skills that share tags, products or a category with Simulation Trading: Tushare Data (zillionare/zillionare, 321 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 875 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 Simulation Trading?

qusong0627 (a GitHub user) maintains it in qusong0627/QuantMind, which has 1,723 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 9, 2026.

Source: qusong0627/QuantMind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.