Skip to content

Fize/mmtickerlab / sim-trade

sim-trade

Verified

A 股专用的确定性模拟交易系统。具备严格的数据真实性门禁、五档盘口真实撮合、T+1 规则、持仓盈亏计算及 SQLite 可审计流水账本。当用户需要进行模拟交易下单、模拟买入/卖出、查询模拟盘持仓、账户资产或重置模拟盘时触发(包含触发词:模拟买入, 模拟卖出, 模拟交易, 查持仓, 模拟盘, 交易账本, sim trade, paper trading)。

references/trading_rules.md

View on GitHub
# Trading rules

Rule version: `cn-a-share-2026-01`

## Supported instruments

Support A-share stocks on Shanghai, Shenzhen, ChiNext, STAR, and Beijing exchanges. Reject funds, ETFs, bonds, options, B-shares, and unknown code ranges.

## Orders and matching

- Accept limit orders only.
- Require a ¥0.01 price tick.
- Require buy quantities in multiples of 100 shares.
- Require sell quantities in multiples of 100 unless the order liquidates all currently free sellable shares for that code.
- Match buys from ask 1 upward where ask price is at or below the limit.
- Match sells from bid 1 downward where bid price is at or above the limit.
- Limit each processing attempt to visible five-level quantity. Keep unfilled quantity open.
- Expire DAY orders after the trading date closes. Permit cancellation before expiration.

## Sessions and settlement

Use `Asia/Shanghai`. Accept placement and processing only on a confirmed trading day during 09:30–11:30 or 13:00–15:00. Shares bought on trading day T become sellable on the next confirmed trading day, not the next calendar day.

## Price limits

Require explicit provider upper/lower prices and validate the order price against them. Do not infer limits solely from the name or code. Reject securities in a no-price-limit period until a dedicated rule and reliable provider flag are implemented.

## Fees

Store account commission terms independently from exchange rules. Defaults:

- commission: 0.025% each side, minimum ¥5 per order;
- transfer fee: 0.001% each side;
- stamp tax: 0.05% on sells only.

Calculate with decimal arithmetic and round each order-level charge to fen using half-up rounding. For a partially filled order, charge only the incremental amount needed to bring cumulative commission to `max(minimum, cumulative turnover × rate)`.

Include buy fees in lot cost. Calculate sell realized P/L as net proceeds less FIFO disposed lot cost.

Official references:

- Shanghai Stock Exchange trading rules: https://www.sse.com.cn/lawandrules/sselawsrules2025/stocks/exchange/c/c_20260424_10816482.shtml
- Shenzhen Stock Exchange trading rules: https://www.szse.cn/lawrules/rule/trade/current/t20260424_620190.html
- Ministry of Finance stamp-tax reduction: https://xj.mof.gov.cn/zcfagui/202311/t20231108_3915476.htm
- ChinaClear transfer fees: https://www.chinaclear.cn/zdjs/editor_file/20220701154723234.pdf
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall