tigerfintech / Openapi Python Sdk
Python SDK for Tiger Open API
Stars: ✭ 80
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Openapi Python Sdk
Rqopen Client
rqopen-client:本地拿到Ricequant上实盘模拟交易策略的交易信号和持仓
Stars: ✭ 78 (-2.5%)
Mutual labels: trade, quant
Strategyease Python Sdk
策略易(StrategyEase)Python SDK,策略自动化交易 API 及量化平台。
Stars: ✭ 741 (+826.25%)
Mutual labels: trade, quant
Abu
阿布量化交易系统(股票,期权,期货,比特币,机器学习) 基于python的开源量化交易,量化投资架构
Stars: ✭ 8,589 (+10636.25%)
Mutual labels: trade, quant
Azure Rest Api Specs
The source for REST API specifications for Microsoft Azure.
Stars: ✭ 1,104 (+1280%)
Mutual labels: openapi
Openapi Connected Service
Visual Studio extension to generate OpenAPI (Swagger) web service reference.
Stars: ✭ 57 (-28.75%)
Mutual labels: openapi
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+13192.5%)
Mutual labels: openapi
Goex
Exchange Rest And WebSocket API For Golang Wrapper support okcoin,okex,huobi,hbdm,bitmex,coinex,poloniex,bitfinex,bitstamp,binance,kraken,bithumb,zb,hitbtc,fcoin, coinbene
Stars: ✭ 1,188 (+1385%)
Mutual labels: quant
Pyspider Stock
A project using pyspider to collect data and NLP techs to analyze the correlation among the data
Stars: ✭ 56 (-30%)
Mutual labels: quant
Connect Api Specification
This repository contains the OpenAPI specification as well as templates for generating SDKs for Square's APIs
Stars: ✭ 56 (-30%)
Mutual labels: openapi
Openapi Mock Generator
Progressive Web App for generating mocked data from an OpenAPI specification
Stars: ✭ 72 (-10%)
Mutual labels: openapi
TigerOpen - 老虎量化开放平台 (Tiger Quant Open API)
简介
老虎开放平台可以为个人开发者和机构客户提供接口服务,投资者可以充分的利用老虎的交易服务、行情服务、账户服务等实现自己的投资应用程序。
安装
pip install tigeropen
或者
git clone https://github.com/tigerfintech/openapi-python-sdk.git
python setup.py install
使用须知
注: 本SDK当前支持Python2, Python3
快速上手
- 行情和交易接口
import traceback
from tigeropen.common.consts import Language, Market, TimelinePeriod, QuoteRight
from tigeropen.common.response import TigerResponse
from tigeropen.quote.quote_client import QuoteClient
from tigeropen.quote.request import OpenApiRequest
from tigeropen.tiger_open_client import TigerOpenClient
from tigeropen.tiger_open_config import TigerOpenClientConfig
from tigeropen.common.util.signature_utils import read_private_key
from tigeropen.common.consts.service_types import ACCOUNTS
from tigeropen.trade.request.model import AccountsParams
from tigeropen.trade.trade_client import TradeClient
def get_client_config():
"""
https://www.itiger.com/openapi/info 开发者信息获取
:return:
"""
is_sandbox = False
client_config = TigerOpenClientConfig(sandbox_debug=is_sandbox)
client_config.private_key = read_private_key('your private key file path')
client_config.tiger_id = 'your tiger id'
client_config.account = 'your account'
client_config.language = Language.en_US
return client_config
def get_account_info():
client_config = get_client_config()
openapi_client = TigerOpenClient(client_config)
account = AccountsParams()
account.account = 'DU575569'
request = OpenApiRequest(method=ACCOUNTS, biz_model=account)
response_content = None
try:
response_content = openapi_client.execute(request)
except Exception as e:
print(traceback.format_exc())
if not response_content:
print("failed to execute")
else:
response = TigerResponse()
response.parse_response_content(response_content)
if response.is_success():
print("get response data:" + response.data)
else:
print(response.code + "," + response.msg + "," + response.data)
def get_trade_apis():
client_config = get_client_config()
trade_client = TradeClient(client_config)
trade_client.get_managed_accounts()
def get_quote_apis():
client_config = get_client_config()
quote_client = QuoteClient(client_config)
quote_client.get_market_status(Market.US)
- 交易信息推送
from tigeropen.common.consts import Language
from tigeropen.common.util.signature_utils import read_private_key
from tigeropen.push.push_client import PushClient
from tigeropen.tiger_open_config import TigerOpenClientConfig
is_sandbox = False
client_config = TigerOpenClientConfig(sandbox_debug=is_sandbox)
client_config.private_key = read_private_key('your private key file path')
# https://www.itiger.com/openapi/info 开发者信息获取
client_config.tiger_id = 'your tiger id'
client_config.account = 'your account'
client_config.language = Language.en_US
protocol, host, port = client_config.socket_host_port
push_client = PushClient(host, port, use_ssl=(protocol == 'ssl'))
push_client.connect(client_config.tiger_id, client_config.private_key)
push_client.subscribe_asset()
time.sleep(600)
push_client.disconnect()
示例代码
- 示例代码位于目录: (tigeropen包安装目录)/tigeropen/examples
开放平台及量化平台交流
- 老虎量化QQ群(869893807)
- 团队或公司客户请在入群后联系群主
使用说明
- 有任何问题可以到 issues 处提出,我们会及时进行解答。
- 使用新版本时请先仔细阅读接口文档,大部分问题都可以在接口文档中找到你想要的答案。
- 欢迎大家提出建议、也可以提出各种需求,我们一定会尽量满足大家的需求。
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].