Fize/mmtickerlab / sim-trade
sim-trade
VerifiedA 股专用的确定性模拟交易系统。具备严格的数据真实性门禁、五档盘口真实撮合、T+1 规则、持仓盈亏计算及 SQLite 可审计流水账本。当用户需要进行模拟交易下单、模拟买入/卖出、查询模拟盘持仓、账户资产或重置模拟盘时触发(包含触发词:模拟买入, 模拟卖出, 模拟交易, 查持仓, 模拟盘, 交易账本, sim trade, paper trading)。
| File | Kind | Size |
|---|---|---|
| .clawhubignore | other | 63 B |
| SKILL.md | skill md | 2.5 KB |
| agents/openai.yaml | config | 258 B |
| references/command_reference.md | markdown | 1.4 KB |
| references/data_contract.md | markdown | 2.9 KB |
| references/trading_rules.md | markdown | 2.3 KB |
| requirements.txt | manifest | 101 B |
| scripts/akshare_patch.py | script | 2.9 KB |
| scripts/simtrade.py | script | 10.0 KB |
| scripts/simtrade_core/__init__.py | script | 105 B |
| scripts/simtrade_core/database.py | script | 6.4 KB |
| scripts/simtrade_core/fees.py | script | 1.7 KB |
| scripts/simtrade_core/market_data.py | script | 9.5 KB |
| scripts/simtrade_core/models.py | script | 5.1 KB |
| scripts/simtrade_core/rules.py | script | 3.5 KB |
| scripts/simtrade_core/service.py | script | 39.4 KB |
| scripts/simtrade_core/trading_calendar.py | script | 4.1 KB |
| tests/test_live_data.py | script | 667 B |
| tests/test_simtrade.py | script | 10.4 KB |
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
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |