tigeropen-go
Installation
SKILL.md
Tiger Open API Go SDK
老虎量化开放平台 Go SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI (Go)
安全警告 / Safety Warning: 交易涉及真实资金。生成交易代码时默认使用模拟账户,除非用户明确要求实盘。实盘下单前必须与用户确认订单详情。 Trading involves real money. Default to Paper Trading when generating trading code. Always confirm order details before live orders.
- Docs: https://docs.itigerup.com/docs/prepare
- GitHub: https://github.com/tigerfintech/openapi-sdks
- Module:
github.com/tigerfintech/openapi-sdks/go| Go 1.20+
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, enums, error handling
- Market Data — Real-time quotes, K-lines, depth, options, futures
- Trading — Place/modify/cancel orders, query positions and assets
- Real-time Push — WebSocket push for quotes, orders, positions, assets
- Account Management — Account list, assets, positions, fund transfer, deposit/withdrawal
- Options Trading — Option chain, expirations, Greeks, multi-leg strategies
Quick Start
package main
import (
"fmt"
"log"
"github.com/tigerfintech/openapi-sdks/go/client"
"github.com/tigerfintech/openapi-sdks/go/config"
"github.com/tigerfintech/openapi-sdks/go/quote"
"github.com/tigerfintech/openapi-sdks/go/trade"
)
func main() {
// 1. 创建配置 / Create config
cfg, err := config.NewClientConfig(
config.WithTigerID("your_tiger_id"),
config.WithPrivateKey("your_rsa_private_key"),
config.WithAccount("your_account"),
)
if err != nil {
log.Fatal(err)
}
// 2. 创建 HTTP 客户端 / Create HTTP client
httpClient := client.NewHttpClient(cfg)
// 3. 查询行情 / Query quotes
qc := quote.NewQuoteClient(httpClient)
result, err := qc.QuoteRealTime([]string{"AAPL", "TSLA"})
if err != nil {
log.Fatal(err)
}
fmt.Println(string(result))
// 4. 交易操作 / Trading
tc := trade.NewTradeClient(httpClient, cfg.Account)
orders, err := tc.Orders()
fmt.Println(string(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 |
Related skills