leapcat-trading
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLeapCat Stock Trading Skill
LeapCat 股票交易 Skill
Place, monitor, and cancel stock trading orders using the leapcat.
使用 leapcat 提交、监控和取消股票交易订单。
Prerequisites
前置要求
- Node.js 18+ is required (commands use which auto-downloads the CLI)
npx leapcat@latest - User must be authenticated — run first
npx leapcat@latest auth login --email <email> - KYC must be completed and approved
- Trade password must be set
- 需要 Node.js 18+ 版本(命令使用 会自动下载 CLI)
npx leapcat@latest - 用户必须完成身份验证——请先运行
npx leapcat@latest auth login --email <email> - 必须完成 KYC 并通过审核
- 必须设置交易密码
Commands
命令说明
trading place-order
trading place-order
Place a new stock order (buy or sell).
bash
npx leapcat@latest trading place-order \
--symbol <symbol> \
--exchange <exchange> \
--side <BUY|SELL> \
--order-type <LIMIT|MARKET> \
--quantity <qty> \
[--price <price>] \
[--source <source>] \
[--stock-name <name>] \
[--idempotency-key <key>] \
--jsonParameters:
- — Stock ticker symbol (e.g.,
--symbol <symbol>,AAPL)9988.HK - — Exchange code (e.g.,
--exchange <exchange>,NASDAQ)HKEX - — Order direction
--side <BUY|SELL> - — Order type; use
--order-type <LIMIT|MARKET>for a specific price orLIMITfor best available priceMARKET - — Number of shares
--quantity <qty> - — Limit price (required for LIMIT orders, ignored for MARKET)
--price <price> - — Order source identifier (default:
--source <source>)CLI - — Human-readable stock name (optional, for display purposes)
--stock-name <name> - — Unique key to prevent duplicate orders (optional but recommended)
--idempotency-key <key>
提交新的股票订单(买入或卖出)。
bash
npx leapcat@latest trading place-order \
--symbol <symbol> \
--exchange <exchange> \
--side <BUY|SELL> \
--order-type <LIMIT|MARKET> \
--quantity <qty> \
[--price <price>] \
[--source <source>] \
[--stock-name <name>] \
[--idempotency-key <key>] \
--json参数说明:
- — 股票代码(例如:
--symbol <symbol>、AAPL)9988.HK - — 交易所代码(例如:
--exchange <exchange>、NASDAQ)HKEX - — 订单方向
--side <BUY|SELL> - — 订单类型;指定价格下单选择
--order-type <LIMIT|MARKET>(限价单),以当前最优价下单选择LIMIT(市价单)MARKET - — 交易股数
--quantity <qty> - — 限价单价格(限价单必填,市价单会忽略该参数)
--price <price> - — 订单来源标识(默认值:
--source <source>)CLI - — 易读的股票名称(可选,用于展示)
--stock-name <name> - — 用于防止重复下单的唯一密钥(可选但推荐使用)
--idempotency-key <key>
trading list-orders
trading list-orders
List the user's orders with optional filters.
bash
npx leapcat@latest trading list-orders [--status <status>] [--symbol <symbol>] --jsonParameters:
- — Filter by order status (e.g.,
--status <status>,PENDING,FILLED)CANCELLED - — Filter by stock symbol
--symbol <symbol>
列出用户的订单,支持可选筛选条件。
bash
npx leapcat@latest trading list-orders [--status <status>] [--symbol <symbol>] --json参数说明:
- — 按订单状态筛选(例如:
--status <status>(待成交)、PENDING(已成交)、FILLED(已取消))CANCELLED - — 按股票代码筛选
--symbol <symbol>
trading get-order
trading get-order
Get details of a specific order.
bash
npx leapcat@latest trading get-order --order-id <id> --jsonParameters:
- — The order identifier
--order-id <id>
获取指定订单的详情。
bash
npx leapcat@latest trading get-order --order-id <id> --json参数说明:
- — 订单ID
--order-id <id>
trading cancel-order
trading cancel-order
Cancel a pending order.
bash
npx leapcat@latest trading cancel-order --order-id <id> --jsonParameters:
- — The order identifier to cancel
--order-id <id>
取消待成交的订单。
bash
npx leapcat@latest trading cancel-order --order-id <id> --json参数说明:
- — 要取消的订单ID
--order-id <id>
Workflow
使用流程
- Get a market quote — Use to check the current price.
npx leapcat@latest market quote --symbol <symbol> --exchange <exchange> --json - Place an order — Run with the desired parameters. For limit orders, set
trading place-orderbased on the quote data. Consider using--priceto avoid duplicate submissions.--idempotency-key - Monitor order status — Run or
trading get-order --order-id <id> --jsonto track the order.trading list-orders --json - Cancel if needed — Run to cancel a pending/unfilled order.
trading cancel-order --order-id <id> --json
- 获取市场行情 — 运行 查看当前价格。
npx leapcat@latest market quote --symbol <symbol> --exchange <exchange> --json - 提交订单 — 按需填写参数运行 。如果是限价单,请根据行情数据设置
trading place-order。推荐使用--price避免重复提交订单。--idempotency-key - 监控订单状态 — 运行 或者
trading get-order --order-id <id> --json跟踪订单状态。trading list-orders --json - 按需取消订单 — 运行 取消待成交/未成交的订单。
trading cancel-order --order-id <id> --json
Error Handling
错误处理
| Error | Cause | Resolution |
|---|---|---|
| Session expired | Re-authenticate with |
| KYC verification incomplete | Complete the KYC flow first |
| Trade password required | Set via |
| Not enough funds for the buy order | Deposit funds via wallet |
| Unrecognized stock symbol | Verify symbol with |
| Market is not open for trading | Wait for market hours or place a limit order |
| Invalid order ID | Re-check with |
| Order already filled or cancelled | No further action possible |
| Idempotency key already used | Use a new idempotency key or check existing order |
| 错误码 | 原因 | 解决方案 |
|---|---|---|
| 会话过期 | 使用 |
| KYC验证未完成 | 先完成KYC认证流程 |
| 需要设置交易密码 | 通过 |
| 买入订单所需资金不足 | 通过钱包充值 |
| 无法识别的股票代码 | 使用 |
| 市场未开放交易 | 等待开盘后操作,或者提交限价单 |
| 订单ID无效 | 运行 |
| 订单已成交或已取消 | 无需进一步操作 |
| 幂等键已被使用 | 使用新的幂等键,或者查询已存在的订单 |