Tiger Open API C# SDK
老虎量化开放平台 C# SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI (C#)
安全警告 / 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 — NuGet install, config, client creation, error handling
- Market Data — Real-time quotes, K-lines, depth, options, futures
- Trading — Place/modify/cancel orders, positions, assets
- Real-time Push — TCP/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
using TigerOpenAPI.Config;
using TigerOpenAPI.Common.Enum;
using TigerOpenAPI.Quote;
using TigerOpenAPI.Quote.Model;
using TigerOpenAPI.Trade;
// 1. 创建配置 / Create config
TigerConfig config = new TigerConfig()
{
ConfigFilePath = "path/to/config/",
Language = Language.en_US,
};
// 2. 查询行情 / Query quotes
QuoteClient quoteClient = new QuoteClient(config);
var request = new TigerRequest<QuoteRealTimeQuoteResponse>()
{
ApiMethodName = QuoteApiService.QUOTE_REAL_TIME,
ModelValue = new QuoteSymbolModel() { Symbols = new List<string> { "AAPL", "TSLA" } }
};
var response = await quoteClient.ExecuteAsync(request);
// 3. 查询订单 / Query orders
TradeClient tradeClient = new TradeClient(config);
var orderRequest = new TigerRequest<OrderBatchResponse>()
{
ApiMethodName = TradeApiService.ORDERS,
ModelValue = new QueryOrderModel() { Account = config.DefaultAccount }
};
var orderResponse = await tradeClient.ExecuteAsync(orderRequest);
When to Use Each Reference
| Task |
Reference |
| First time setup, NuGet 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 TCP socket |
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-csharp3description: Tiger Brokers OpenAPI C# 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 C#/.NET, querying market data, placing orders, or integrating Tiger Brokers API. 老虎证券 OpenAPI C# SDK 完整技能集。涵盖 SDK 配置、行情查询、交易、实时推送订阅。适用于用 C#/.NET 构建交易应用、查询行情数据、下单交易。 用户提到以下关键词时自动使用 / Auto-activate on these keywords: 行情、报价、K线、买入、卖出、下单、撤单、交易、持仓、资金、账户、订单、期权、期货、推送、订阅、C# SDK、csharp SDK、dotnet SDK、tigeropen csharp、openapi csharp、quote、price、K-line、order、buy、sell、trade、position、asset、option、future、push4license: Apache-2.05---67# Tiger Open API C# SDK89> 老虎量化开放平台 C# SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI (C#)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://quant.itigerup.com/openapi/zh/csharp/overview/introduction.html15- GitHub: https://github.com/tigerfintech/openapi-cs-sdk16- .NET 10.0 (net10.0), C# 14 default1718## Language Rules / 语言规则1920根据用户输入语言自动回复。技术术语(代码、API 名称、参数名)保持原文不翻译。21Reply in the user's language. Keep technical terms (code, API names, parameters) as-is.2223## Reference Guides2425- **[Quickstart](references/quickstart.md)** — NuGet install, config, client creation, error handling26- **[Market Data](references/quote.md)** — Real-time quotes, K-lines, depth, options, futures27- **[Trading](references/trade.md)** — Place/modify/cancel orders, positions, assets28- **[Real-time Push](references/push.md)** — TCP/WebSocket push for quotes, orders, positions29- **[Account Management](references/account.md)** — Account list, assets, positions, fund transfer, deposit/withdrawal30- **[Options Trading](references/option.md)** — Option chain, expirations, Greeks, multi-leg strategies3132## Quick Start3334```csharp35using TigerOpenAPI.Config;36using TigerOpenAPI.Common.Enum;37using TigerOpenAPI.Quote;38using TigerOpenAPI.Quote.Model;39using TigerOpenAPI.Trade;4041// 1. 创建配置 / Create config42TigerConfig config = new TigerConfig()43{44 ConfigFilePath = "path/to/config/",45 Language = Language.en_US,46};4748// 2. 查询行情 / Query quotes49QuoteClient quoteClient = new QuoteClient(config);50var request = new TigerRequest<QuoteRealTimeQuoteResponse>()51{52 ApiMethodName = QuoteApiService.QUOTE_REAL_TIME,53 ModelValue = new QuoteSymbolModel() { Symbols = new List<string> { "AAPL", "TSLA" } }54};55var response = await quoteClient.ExecuteAsync(request);5657// 3. 查询订单 / Query orders58TradeClient tradeClient = new TradeClient(config);59var orderRequest = new TigerRequest<OrderBatchResponse>()60{61 ApiMethodName = TradeApiService.ORDERS,62 ModelValue = new QueryOrderModel() { Account = config.DefaultAccount }63};64var orderResponse = await tradeClient.ExecuteAsync(orderRequest);65```6667## When to Use Each Reference6869| Task | Reference |70|------|-----------|71| First time setup, NuGet install, auth config | [quickstart.md](references/quickstart.md) |72| Get stock/option/future quotes, K-lines | [quote.md](references/quote.md) |73| Place/modify/cancel orders, check positions/assets | [trade.md](references/trade.md) |74| Real-time streaming data via TCP socket | [push.md](references/push.md) |75| Account info, assets, fund transfer, deposit/withdrawal | [account.md](references/account.md) |76| Option chain, Greeks, expirations, multi-leg orders | [option.md](references/option.md) |7778## Common Symbols / 常见标的速查7980### 港股 HK8182| 常见称呼 | 代码 Symbol |83|---------|------------|84| 腾讯 | 00700 |85| 阿里巴巴 | 09988 |86| 美团 | 03690 |87| 小米 | 01810 |8889### 美股 US9091| 常见称呼 | 代码 Symbol |92|---------|------------|93| 苹果 / Apple | AAPL |94| 特斯拉 / Tesla | TSLA |95| 英伟达 / NVIDIA | NVDA |96| 微软 / Microsoft | MSFT |97| 谷歌 / Google | GOOGL |98| 亚马逊 / Amazon | AMZN |99| Meta | META |100| 老虎证券 / TIGR | TIGR |101| 标普500 ETF / SPY | SPY |102| 纳指 ETF / QQQ | QQQ |