All Projects → shinnytech → Tqsdk Python

shinnytech / Tqsdk Python

Licence: apache-2.0
天勤量化开发包, 期货量化, 实时行情/历史数据/实盘交易

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tqsdk Python

tqsdk-js
期货行情/历史数据/交易 开发包
Stars: ✭ 52 (-97.65%)
Mutual labels:  diff, futures, program-trading
backend-ctp
CTP接口封装,使用redis做消息中转
Stars: ✭ 26 (-98.83%)
Mutual labels:  quant, futures
akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 5,155 (+132.94%)
Mutual labels:  quant, futures
open-md-gateway
Diff协议行情网关, 支持实时行情和历史行情
Stars: ✭ 18 (-99.19%)
Mutual labels:  diff, futures
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 (-46.32%)
Mutual labels:  futures, quant
openctp
CTP开放平台提供A股、港股、美股、期货、期权等全品种接入通道,通过提供中泰证券XTP、华鑫证券奇点、东方证券OST、东方财富证券EMT、盈透证券TWS等各通道的CTPAPI接口,CTP程序可以无缝对接各股票柜台。平台也提供了一套基于TTS交易系统的模拟环境,同样提供了CTPAPI兼容接口,可以替代Simnow,为CTP量化交易开发者提供7x24可用的模拟环境。
Stars: ✭ 389 (-82.42%)
Mutual labels:  quant, futures
trader
交易模块
Stars: ✭ 20 (-99.1%)
Mutual labels:  quant, futures
Akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 4,334 (+95.84%)
Mutual labels:  futures, quant
Rqalpha
A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
Stars: ✭ 4,425 (+99.95%)
Mutual labels:  futures, quant
Shinny Futures Android
一个开源的 android 平台期货行情交易终端
Stars: ✭ 120 (-94.58%)
Mutual labels:  futures, diff
Amazingquant
基于Event-driven的量化交易解决方案
Stars: ✭ 128 (-94.22%)
Mutual labels:  quant
Sumzerotrading
A Java API for Developing Automated Trading Applications for the Equity, Futures, and Currency Markets
Stars: ✭ 128 (-94.22%)
Mutual labels:  futures
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (-1.85%)
Mutual labels:  quant
Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (-93.76%)
Mutual labels:  diff
Winmerge
WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
Stars: ✭ 2,358 (+6.55%)
Mutual labels:  diff
Angular Diff Match Patch
An AngularJS wrapper for google-diff-match-patch
Stars: ✭ 135 (-93.9%)
Mutual labels:  diff
Php Diff
A comprehensive library for generating differences between two strings in multiple formats (unified, side by side HTML etc).
Stars: ✭ 126 (-94.31%)
Mutual labels:  diff
Learnvue
Vue.js 源码解析
Stars: ✭ 11,516 (+420.38%)
Mutual labels:  diff
Prettydiff
Beautifier and language aware code comparison tool for many languages. It also minifies and a few other things.
Stars: ✭ 1,635 (-26.12%)
Mutual labels:  diff
Friartuck
Live Quant Trading Framework for Robinhood, using IEX Trading and AlphaVantage for Free Prices.
Stars: ✭ 142 (-93.58%)
Mutual labels:  quant

TqSdk 天勤量化交易策略程序开发包

TqSdk 是一个由信易科技发起并贡献主要代码的开源 python 库. 依托快期多年积累成熟的交易及行情服务器体系, TqSdk 支持用户使用极少的代码量构建各种类型的量化交易策略程序, 并提供包含期货、期权、股票的 历史数据-实时数据-开发调试-策略回测-模拟交易-实盘交易-运行监控-风险管理 全套解决方案.

from tqsdk import TqApi, TqAuth, TqAccount, TargetPosTask

api = TqApi(TqAccount("H海通期货", "4003242", "123456"), auth=TqAuth("信易账户", "账户密码"))      # 创建 TqApi 实例, 指定交易账户
q_1910 = api.get_quote("SHFE.rb1910")                         # 订阅近月合约行情
t_1910 = TargetPosTask(api, "SHFE.rb1910")                    # 创建近月合约调仓工具
q_2001 = api.get_quote("SHFE.rb2001")                         # 订阅远月合约行情
t_2001 = TargetPosTask(api, "SHFE.rb2001")                    # 创建远月合约调仓工具

while True:
  api.wait_update()                                           # 等待数据更新
  spread = q_1910["last_price"] - q_2001["last_price"]        # 计算近月合约-远月合约价差
  print("当前价差:", spread)
  if spread > 250:
    print("价差过高: 空近月,多远月")                            
    t_1910.set_target_volume(-1)                              # 要求把1910合约调整为空头1手
    t_2001.set_target_volume(1)                               # 要求把2001合约调整为多头1手
  elif spread < 200:
    print("价差回复: 清空持仓")                               # 要求把 1910 和 2001合约都调整为不持仓
    t_1910.set_target_volume(0)
    t_2001.set_target_volume(0)

要快速了解如何使用TqSdk, 可以访问我们的 十分钟快速入门指南.

Architecture

系统架构图

Features

TqSdk 提供的功能可以支持从简单到复杂的各类策略程序.

  • 公司级数据运维,提供当前所有可交易合约从上市开始的 全部Tick数据和K线数据
  • 支持市场上90%的期货公司 实盘交易
  • 支持 模拟交易
  • 支持 Tick级和K线级回测, 支持 复杂策略回测
  • 提供近百个 技术指标函数及源码
  • 用户无须建立和维护数据库, 行情和交易数据全在 内存数据库 , 无访问延迟
  • 优化支持 pandasnumpy
  • 无强制框架结构, 支持任意复杂度的策略, 在一个交易策略程序中使用多个品种的K线/实时行情并交易多个品种
  • 配合开发者支持工具,能够进行交易信号打点,支持自定义指标画图

Installation

TqSdk 仅支持 Python 3.6 及更高版本. 要安装 TqSdk, 可使用 pip:

$ pip install tqsdk

Documentation

在线阅读HTML版本文档: https://doc.shinnytech.com/tqsdk/latest

在线问答社区: https://www.shinnytech.com/qa

知乎账户【天勤量化】:https://www.zhihu.com/org/tian-qin-liang-hua/activities

用户交流QQ群: 619870862 (目前只允许给我们点过STAR的同学加入, 加群时请提供github用户名)

Gui

TqSdk本身自带的web_gui功能,简单一行参数即可支持调用图形化界面,详情参考web_gui TqSdk web_gui

About us

信易科技 是专业的期货软件供应商和交易所授权行情服务商. 旗下的快期系列产品已为市场服务超过10年. TqSdk 是公司开源计划的一部分.

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].