老虎量化开放平台 Python SDK 完整技能集 / Complete AI skill set for Tiger Brokers OpenAPI
安全警告 / Safety Warning: 交易涉及真实资金。生成交易代码时默认使用 模拟账户(Paper Trading),除非用户明确要求实盘。实盘下单前必须与用户确认订单详情。 Trading involves real money. Default to Paper Trading account when generating trading code unless the user explicitly requests live trading. Always confirm order details with the user before live orders.
pip install tigeropen | Python 3.8 - 3.14根据用户输入语言自动回复。用户使用英文提问则用英文回复,使用中文提问则用中文回复。技术术语(代码、API 名称、参数名)保持原文不翻译。 Reply in the user's language. Keep technical terms (code, API names, parameters) as-is.
This skill is organized into focused reference files. Load the relevant guide based on your task:
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 / 配置
# 方式一:配置文件(推荐) / Method 1: Config file (recommended)
config = TigerOpenClientConfig(props_path='/path/to/your/config/')
# 方式二:代码赋值 / Method 2: Code assignment
# config = TigerOpenClientConfig()
# config.tiger_id = 'your_tiger_id'
# config.private_key = read_private_key('/path/to/your_private_key.pem')
# config.account = 'your_account'
# config.language = Language.en_US
# 2. Query quotes / 查询行情
quote_client = QuoteClient(config)
quote = quote_client.get_market_status(Market.US)
# 3. Place order / 下单
trade_client = TradeClient(config)
# See references/trade.md for order examples
TaskReferenceFirst time setup, SDK install, auth configquickstart.mdGet stock/option/future quotes, K-lines, screenerquote.mdPlace/modify/cancel orders, check positions/assetstrade.mdOption chains, Greeks, combo strategiesoption.mdReal-time streaming data via WebSocketpush.mdCLI commands: query data, manage orders from terminalcli.mdSet up MCP Server for AI editor integrationmcp.md
当用户使用中文名称或英文简称时,按下表映射。不在表中的标的根据上下文判断。 Map user's natural language to symbols. For unlisted symbols, infer from context.
常见称呼代码 Symbol腾讯00700阿里巴巴、阿里09988美团03690小米01810京东09618比亚迪01211快手01024百度09888网易09999中芯国际00981MINIMAX00100智谱02513
常见称呼代码 Symbol苹果 / AppleAAPL特斯拉 / TeslaTSLA英伟达 / NVIDIANVDA微软 / MicrosoftMSFT谷歌 / GoogleGOOGL亚马逊 / AmazonAMZNMetaMETA台积电 / TSMTSMAMDAMD老虎证券 / Tiger / TIGRTIGR阿里巴巴(美股)/ BABABABA京东(美股)/ JDJD拼多多 / PDDPDD标普500 ETF / SPYSPY纳指 ETF / QQQQQQ