tigeropen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tiger Open API Python SDK

Tiger Open API Python SDK

老虎量化开放平台 Python SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI
老虎量化开放平台 Python SDK 完整技能集 / 老虎证券OpenAPI的完整AI技能集

Reference Guides

参考指南

This skill is organized into focused reference files. Load the relevant guide based on your task:
  • Quickstart — SDK install, authentication, client setup, enums/objects, error codes, FAQ
  • Market Data — Real-time quotes, K-lines, depth, ticks, capital flow, fundamentals, scanner
  • Trading — Place orders (market/limit/stop/algo), order management, assets, positions, fund transfers
  • Options — Option chains, Greeks, single-leg/multi-leg combos, option calculator
  • Real-time Push — Subscribe to quote/depth/tick/K-line/order/position/asset changes via PushClient
  • CLI Tool — Command-line interface: config, quote, trade, account, push commands with table/json/csv output
  • MCP Server — Expose Tiger API as MCP tools for Cursor, Claude Code, Kiro, Trae
本技能集按功能拆分了专项参考文件,你可以根据当前任务加载对应的指南:
  • 快速开始 — 包含SDK安装、身份验证、客户端配置、枚举/对象定义、错误码、常见问题
  • 行情数据 — 包含实时行情、K线、深度行情、逐笔成交、资金流向、基本面数据、选股器
  • 交易功能 — 包含下单(市价/限价/止损/算法单)、订单管理、资产查询、持仓查询、资金划转
  • 期权功能 — 包含期权链、希腊值、单腿/多腿组合策略、期权计算器
  • 实时推送 — 可通过PushClient订阅行情/深度/逐笔/K线/订单/持仓/资产变动通知
  • CLI工具 — 命令行界面:支持配置、行情、交易、账户、推送相关命令,可输出table/json/csv格式
  • MCP Server — 将老虎API封装为MCP工具,可对接Cursor、Claude Code、Kiro、Trae

Quick Start

快速开始

python
from tigeropen.common.consts import Language, Market
from tigeropen.tiger_open_config import TigerOpenClientConfig
from tigeropen.common.util.signature_utils import read_private_key
from tigeropen.quote.quote_client import QuoteClient
from tigeropen.trade.trade_client import TradeClient
python
from tigeropen.common.consts import Language, Market
from tigeropen.tiger_open_config import TigerOpenClientConfig
from tigeropen.common.util.signature_utils import read_private_key
from tigeropen.quote.quote_client import QuoteClient
from tigeropen.trade.trade_client import TradeClient

1. Configure / 配置

1. 配置

方式一:配置文件(推荐) / Method 1: Config file (recommended)

方式一:配置文件(推荐)

config = TigerOpenClientConfig(props_path='/path/to/your/config/')
config = TigerOpenClientConfig(props_path='/path/to/your/config/')

方式二:代码赋值 / Method 2: Code assignment

方式二:代码赋值

config = TigerOpenClientConfig()

config = TigerOpenClientConfig()

config.tiger_id = 'your_tiger_id'

config.tiger_id = 'your_tiger_id'

config.private_key = read_private_key('/path/to/your_private_key.pem')

config.private_key = read_private_key('/path/to/your_private_key.pem')

config.account = 'your_account'

config.account = 'your_account'

config.language = Language.en_US

config.language = Language.en_US

2. Query quotes / 查询行情

2. 查询行情

quote_client = QuoteClient(config) quote = quote_client.get_market_status(Market.US)
quote_client = QuoteClient(config) quote = quote_client.get_market_status(Market.US)

3. Place order / 下单

3. 下单

trade_client = TradeClient(config)
trade_client = TradeClient(config)

See references/trade.md for order examples

订单示例可查看 references/trade.md

undefined
undefined

When to Use Each Reference

各参考文档适用场景

TaskReference
First time setup, SDK install, auth configquickstart.md
Get stock/option/future quotes, K-lines, screenerquote.md
Place/modify/cancel orders, check positions/assetstrade.md
Option chains, Greeks, combo strategiesoption.md
Real-time streaming data via WebSocketpush.md
CLI commands: query data, manage orders from terminalcli.md
Set up MCP Server for AI editor integrationmcp.md
任务参考文档
首次配置、SDK安装、身份验证配置quickstart.md
获取股票/期权/期货行情、K线、选股筛选quote.md
下单/改单/撤单、查询持仓/资产trade.md
期权链、希腊值、组合策略option.md
通过WebSocket获取实时数据流push.md
CLI命令:从终端查询数据、管理订单cli.md
配置MCP Server用于对接AI编辑器mcp.md