Tiger Open API TypeScript SDK
老虎量化开放平台 TypeScript SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI (TypeScript)
安全警告 / Safety Warning: 交易涉及真实资金。生成交易代码时默认使用模拟账户,除非用户明确要求实盘。实盘下单前必须与用户确认订单详情。
Trading involves real money. Default to Paper Trading when generating trading code. Always confirm order details before live orders.
Language Rules / 语言规则
根据用户输入语言自动回复。技术术语(代码、API 名称、参数名)保持原文不翻译。
Reply in the user's language. Keep technical terms (code, API names, parameters) as-is.
Reference Guides
- Quickstart — SDK install, config, client setup, error handling
- Market Data — Real-time quotes, K-lines, depth, options, futures
- Trading — Place/modify/cancel orders, positions, assets
- Real-time Push — WebSocket push for quotes, orders, positions
- Account Management — Account list, assets, positions, fund transfer, deposit/withdrawal
- Options Trading — Option chain, expirations, Greeks, multi-leg strategies
Quick Start
import {
createClientConfig,
HttpClient,
QuoteClient,
TradeClient,
} from '@tigeropenapi/tigeropen';
// 1. 创建配置 / Create config
const config = createClientConfig({
tigerId: 'your_tiger_id',
privateKey: 'your_rsa_private_key',
account: 'your_account',
});
// 2. 查询行情 / Query quotes(注意:接收请求对象,不是数组)
const httpClient = new HttpClient(config);
const qc = new QuoteClient(httpClient);
const quotes = await qc.getBrief({ symbols: ['AAPL', 'TSLA'] });
console.log(quotes);
// 3. 交易操作 / Trading
const tc = new TradeClient(httpClient, config.account);
const orders = await tc.getOrders({ limit: 20 });
console.log(orders);
When to Use Each Reference
| Task |
Reference |
| First time setup, SDK install, auth config |
quickstart.md |
| Get stock/option/future quotes, K-lines |
quote.md |
| Place/modify/cancel orders, check positions/assets |
trade.md |
| Real-time streaming data via WebSocket |
push.md |
| Account info, assets, fund transfer, deposit/withdrawal |
account.md |
| Option chain, Greeks, expirations, multi-leg orders |
option.md |
Common Symbols / 常见标的速查
港股 HK
| 常见称呼 |
代码 Symbol |
| 腾讯 |
00700 |
| 阿里巴巴 |
09988 |
| 美团 |
03690 |
| 小米 |
01810 |
美股 US
| 常见称呼 |
代码 Symbol |
| 苹果 / Apple |
AAPL |
| 特斯拉 / Tesla |
TSLA |
| 英伟达 / NVIDIA |
NVDA |
| 微软 / Microsoft |
MSFT |
| 谷歌 / Google |
GOOGL |
| 亚马逊 / Amazon |
AMZN |
| Meta |
META |
| 老虎证券 / TIGR |
TIGR |
| 标普500 ETF / SPY |
SPY |
| 纳指 ETF / QQQ |
QQQ |
1---2name: tigeropen-typescript3description: Tiger Brokers OpenAPI TypeScript SDK — complete skills for AI coding tools. Covers SDK setup, market data queries, trading, and real-time push subscriptions. Use when building trading applications in TypeScript/Node.js, querying market data, placing orders, or integrating Tiger Brokers API. 老虎证券 OpenAPI TypeScript SDK 完整技能集。涵盖 SDK 配置、行情查询、交易、实时推送订阅。适用于用 TypeScript/Node.js 构建交易应用、查询行情数据、下单交易。 用户提到以下关键词时自动使用 / Auto-activate on these keywords: 行情、报价、K线、买入、卖出、下单、撤单、交易、持仓、资金、账户、订单、期权、期货、推送、订阅、TypeScript SDK、tigeropen typescript、quote、price、K-line、order、buy、sell、trade、position、asset、option、future、push4license: MIT5---67# Tiger Open API TypeScript SDK89> 老虎量化开放平台 TypeScript SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI (TypeScript)1011> **安全警告 / Safety Warning**: 交易涉及真实资金。生成交易代码时默认使用**模拟账户**,除非用户明确要求实盘。实盘下单前必须与用户确认订单详情。12> Trading involves real money. Default to **Paper Trading** when generating trading code. Always confirm order details before live orders.1314- Docs: https://docs.itigerup.com/docs/prepare15- npm: `npm install @tigeropenapi/tigeropen` | Node.js 16+, ESM/CommonJS1617## Language Rules / 语言规则1819根据用户输入语言自动回复。技术术语(代码、API 名称、参数名)保持原文不翻译。20Reply in the user's language. Keep technical terms (code, API names, parameters) as-is.2122## Reference Guides2324- **[Quickstart](references/quickstart.md)** — SDK install, config, client setup, error handling25- **[Market Data](references/quote.md)** — Real-time quotes, K-lines, depth, options, futures26- **[Trading](references/trade.md)** — Place/modify/cancel orders, positions, assets27- **[Real-time Push](references/push.md)** — WebSocket push for quotes, orders, positions28- **[Account Management](references/account.md)** — Account list, assets, positions, fund transfer, deposit/withdrawal29- **[Options Trading](references/option.md)** — Option chain, expirations, Greeks, multi-leg strategies3031## Quick Start3233```typescript34import {35 createClientConfig,36 HttpClient,37 QuoteClient,38 TradeClient,39} from '@tigeropenapi/tigeropen';4041// 1. 创建配置 / Create config42const config = createClientConfig({43 tigerId: 'your_tiger_id',44 privateKey: 'your_rsa_private_key',45 account: 'your_account',46});4748// 2. 查询行情 / Query quotes(注意:接收请求对象,不是数组)49const httpClient = new HttpClient(config);50const qc = new QuoteClient(httpClient);51const quotes = await qc.getBrief({ symbols: ['AAPL', 'TSLA'] });52console.log(quotes);5354// 3. 交易操作 / Trading55const tc = new TradeClient(httpClient, config.account);56const orders = await tc.getOrders({ limit: 20 });57console.log(orders);58```5960## When to Use Each Reference6162| Task | Reference |63|------|-----------|64| First time setup, SDK install, auth config | [quickstart.md](references/quickstart.md) |65| Get stock/option/future quotes, K-lines | [quote.md](references/quote.md) |66| Place/modify/cancel orders, check positions/assets | [trade.md](references/trade.md) |67| Real-time streaming data via WebSocket | [push.md](references/push.md) |68| Account info, assets, fund transfer, deposit/withdrawal | [account.md](references/account.md) |69| Option chain, Greeks, expirations, multi-leg orders | [option.md](references/option.md) |7071## Common Symbols / 常见标的速查7273### 港股 HK7475| 常见称呼 | 代码 Symbol |76|---------|------------|77| 腾讯 | 00700 |78| 阿里巴巴 | 09988 |79| 美团 | 03690 |80| 小米 | 01810 |8182### 美股 US8384| 常见称呼 | 代码 Symbol |85|---------|------------|86| 苹果 / Apple | AAPL |87| 特斯拉 / Tesla | TSLA |88| 英伟达 / NVIDIA | NVDA |89| 微软 / Microsoft | MSFT |90| 谷歌 / Google | GOOGL |91| 亚马逊 / Amazon | AMZN |92| Meta | META |93| 老虎证券 / TIGR | TIGR |94| 标普500 ETF / SPY | SPY |95| 纳指 ETF / QQQ | QQQ |