← 返回
开发者工具 Key 中文

Tiger Trade

Execute US and HK stock trades via Tiger Brokers API. Use when user wants to buy or sell stocks, manage investment portfolio, place orders for US ETFs or HK...
{"answer":"通过老虎证券API交易美港股。用于买卖股票、管理投资组合、下单美股ETF或港股..."}
esanle
开发者工具 clawhub v1.0.5 2 版本 100000 Key: 需要
★ 0
Stars
📥 1,068
下载
💾 57
安装
2
版本
#latest

概述

Tiger Trade

Execute trades via Tiger Brokers API.

Setup

Create config file at ~/.tiger-config.json :

{
  "tiger_id": "your_tiger_id",
  "account": "your_account",
  "private_key_pk8": "your_private_key"
}

Check Stock Prices

Use Tiger Broker website to get current prices:

https://www.itiger.com/hant/stock/02800
https://www.itiger.com/hant/stock/AAPL

Replace the stock code (02800 or AAPL) with any stock

Quick Trade

import json
from tigeropen.tiger_open_config import TigerOpenClientConfig
from tigeropen.trade.trade_client import TradeClient
from tigeropen.trade.request.model import PlaceModifyOrderParams
from tigeropen.common.consts import OrderType

with open('~/.tiger-config.json', 'r') as f:
    config = json.load(f)

client_config = TigerOpenClientConfig()
client_config.tiger_id = config['tiger_id']
client_config.account = config['account']
client_config.private_key = config['private_key_pk8']
client_config.sandbox = False

client = TradeClient(client_config)

# Place stock order
contracts = client.get_contracts(['02800'])
if contracts:
    order_params = PlaceModifyOrderParams()
    order_params.account = config['account']
    order_params.contract = contracts[0]
    order_params.action = 'BUY'
    order_params.order_type = OrderType.LMT.value
    order_params.limit_price = 26.80  # Get from itiger.com
    order_params.quantity = 10000
    
    result = client.place_order(order_params)
    print(result)

Order Types

  • LMT = Limit order
  • MKT = Market order

Actions

  • BUY - 买入
  • SELL - 卖出

版本历史

共 2 个版本

  • v1.0.5 当前
    2026-03-29 12:30 安全 安全
  • v1.0.2
    2026-03-07 01:55

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,520
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,469
data-analysis

Youtube Notification Analysis

esanle
分析YouTube通知,获取投资和交易洞察。当用户希望从YouTube获取投资建议、分析股票、加密货币或金融相关内容时使用。
★ 0 📥 1,038