A股模拟盘交易与回测技能。Use when 用户要启动模拟仓服务、创建多账户、下限价单/市价单、撤单、查询持仓资金、验证涨跌停成交逻辑或运行A股回测。
npx skills add https://github.com/shouldnotappearcalm/a-share-skill --skill a-share-paper-trading
独立的模拟盘 skill。交易服务、CLI、账户、撮合与行情适配都在本目录内,不依赖其他 skill 脚本。
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 目录,而是落到用户级数据目录:
~/Library/Application Support/a-share-paper-trading/paper_trading.db${XDG_DATA_HOME:-~/.local/share}/a-share-paper-trading/paper_trading.db若本机该端口已有模拟盘进程在跑,不要再启动第二个实例:会报 Address already in use,且多进程可能争用同一 SQLite 库文件。启动前可先检查端口是否在监听,例如:
lsof -iTCP:18765 -sTCP:LISTEN
或向 http://127.0.0.1:18765/accounts 发 GET(CLI 默认 --base-url 与此一致)。已有服务时直接用 paper_trade_cli.py 即可。
更推荐使用控制脚本常驻运行:
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:
python3 "$SKILL_DIR/scripts/paper_trading_ctl.py" install-launchd
服务会:
可用启动参数:
--host--port--db-path--match-interval--valuation-interval--idle-valuation-interval默认端口与 CLI 基址已改为 18765,避免和常见本地开发服务冲突。
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-accountshow-default-accountset-default-accountreset-accountlist-accountsshow-accountpositionsorderstradesbuysellcanceladd-cashdeduct-cashprocess-ordersrun-snapshotsbacktestshow-default-account 可查),且用户未指定账户,优先使用默认账户。set-default-account。1000000(100w),提问模板建议为:buy/sell:--price。--market,不应再传 --price。orders --status 可用值:open / filled / cancelled / expired / rejected。add-cash / deduct-cash 的 amount 必须为正数,单位为人民币元。--json 输出,便于后续结构化解析与决策。show-default-account 或 list-accounts。show-account <account_id>。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:改用限价单或等待交易时段。0.01 元最小报价单位10%20%5%scripts/paper_trading_service.py: 启动 HTTP 服务scripts/paper_trade_cli.py: CLIscripts/paper_trading_ctl.py: 启停、状态、launchd 安装scripts/paper_trading_runtime.py: 运行时默认目录、端口、路径scripts/paper_trading/: 账户、撮合、估值、数据适配默认暴露这些 HTTP 路由:
GET /accountsGET /accounts/defaultPOST /accountsPOST /accounts/defaultGET /accounts/{account_id}POST /accounts/{account_id}/resetPOST /accounts/{account_id}/cash-adjustGET /accounts/{account_id}/positionsGET /accounts/{account_id}/ordersGET /accounts/{account_id}/tradesPOST /ordersPOST /orders/{order_id}/cancelPOST /orders/processPOST /snapshots/runPOST /backtestGET /healthGenerate comprehensive equity research snapshots combining analyst consensus estimates, company fundamentals, historical prices, and macroeconomic context. Use when researching stocks, comparing estimates to actuals, analyzing company financials, assessing equity valuations, or building investment cases.
Systematic stock screening and investment idea sourcing. Combines quantitative screens, thematic research, and pattern recognition to surface new long and short ideas. Use when looking for new ideas, running screens, or conducting thematic sweeps. Triggers on "idea generation", "stock screen", "find ideas", "what looks interesting", "screen for", "new ideas", or "pitch me something".
Extracts protocol message flow from source code, RFCs, academic papers, pseudocode, informal prose, ProVerif (.pv), or Tamarin (.spthy) models and generates Mermaid sequenceDiagrams with cryptographic annotations. Use when diagramming a crypto protocol, visualizing a handshake or key exchange flow, extracting message flow from a spec or RFC, diagramming a ProVerif or Tamarin model, or drawing sequence diagrams for TLS, Noise, Signal, X3DH, Double Ratchet, FROST, DH, or ECDH protocols.
> Fetch structured stock sentiment across Reddit, X.com, news, and Polymarket using the Adanos Finance API. Use this skill whenever the user asks how much people are talking about a stock, how hot a ticker is on social platforms, how many Polymarket bets exist for a company, whether sources are aligned, or "social sentiment on TSLA", "how hot is NVDA on X.com", "how many Reddit mentions does AAPL have", "compare sentiment on AMD vs NVDA", "how many Polymarket bets on Microsoft", "is Reddit aligned with X on META", "stock buzz", "bullish percentage", and any mention of cross-source stock sentiment research. This skill is READ-ONLY and does not place trades or modify anything.
> Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. "who follows", "look up @user", "what's trending about", "market sentiment on Twitter", "what are people saying about AAPL", "recent tweets from @elonmusk", "show me @user's posts", "fintwit", any mention of Twitter/X in context of reading financial news or market research. This skill is READ-ONLY — it does NOT support posting, liking, retweeting, or any write operations.
A jurisdiction-grounding reference file for AI assistants working on Gibraltar legal, regulatory, and compliance research. Corrects systematic errors AI models make when applying English law to Gibraltar — a distinct jurisdiction under the Gibraltar Constitution Order 2006, with its own court hierarchy, civil procedure rules, employment law, and regulatory framework. Covers the source hierarchy, court structure, civil procedure divergences (14-day deemed service, post-Jackson reforms not adopted), employment law specifics (uncapped discrimination awards, 5-employee redundancy threshold), FSC financial services regulation, AML/KYC compliance sources, Gibraltar Companies Act 2014 with UBO public register, and a structured directory of official public record sources. Includes research profiles for lawyers, compliance professionals, and due diligence practitioners. Not legal advice.
Researches SEC filings, earnings calls, analyst reports, and market data. Use when the album subject involves financial crimes, corporate stories, or market events.
Comprehensive cryptocurrency market research and analysis using specialized AI agents. Analyzes market data, price trends, news sentiment, technical indicators, macro correlations, and investment opportunities. Use when researching cryptocurrencies, analyzing crypto markets, evaluating digital assets, or investigating blockchain projects like Bitcoin, Ethereum, Solana, etc.
Take shouldnotappearcalm/a-share-paper-trading from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.