All Projects → abramwang → QuantStageApi_Python

abramwang / QuantStageApi_Python

Licence: other
PT_QuantBaseApi python version

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to QuantStageApi Python

Iex Api Python
A python wrapper for the IEX API
Stars: ✭ 41 (+215.38%)
Mutual labels:  market-data
Roq Api
API for algorithmic and high-frequency trading
Stars: ✭ 132 (+915.38%)
Mutual labels:  market-data
Shioaji
Shioaji all new cross platform api for trading ( 跨平台證券交易API )
Stars: ✭ 203 (+1461.54%)
Mutual labels:  market-data
Ccxt.net
CCXT.NET – CryptoCurrency eXchange Trading Library for .NET
Stars: ✭ 89 (+584.62%)
Mutual labels:  market-data
Sumzerotrading
A Java API for Developing Automated Trading Applications for the Equity, Futures, and Currency Markets
Stars: ✭ 128 (+884.62%)
Mutual labels:  market-data
Ib Gateway Docker
Interactive Brokers Trading Gateway running in Docker
Stars: ✭ 149 (+1046.15%)
Mutual labels:  market-data
Bgg Analysis
What makes a game a good game?
Stars: ✭ 18 (+38.46%)
Mutual labels:  market-data
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+1807.69%)
Mutual labels:  market-data
Pytse Client
work with Tehran stock exchange data in Python
Stars: ✭ 130 (+900%)
Mutual labels:  market-data
Trade Frame
c++ based application for testing options based automated trading ideas using DTN IQ real time data feed and Interactive Brokers (TWS API) for trade execution.
Stars: ✭ 187 (+1338.46%)
Mutual labels:  market-data
Crypto
Cryptocurrency Historical Market Data R Package
Stars: ✭ 112 (+761.54%)
Mutual labels:  market-data
Tardis Node
Convenient access to tick-level real-time and historical cryptocurrency market data via Node.js
Stars: ✭ 126 (+869.23%)
Mutual labels:  market-data
Coingecko Api
A Node.js wrapper for the CoinGecko API with no dependencies.
Stars: ✭ 159 (+1123.08%)
Mutual labels:  market-data
Mplfinance
Financial Markets Data Visualization using Matplotlib
Stars: ✭ 1,043 (+7923.08%)
Mutual labels:  market-data
Tosdatabridge
A collection of resources for pulling real-time streaming data off of TDAmeritrade's ThinkOrSwim(TOS) platform; providing C, C++, Java and Python interfaces.
Stars: ✭ 229 (+1661.54%)
Mutual labels:  market-data
Bitcoinexchangefh
Cryptocurrency exchange market data feed handler
Stars: ✭ 871 (+6600%)
Mutual labels:  market-data
Opentick
A fast tick database for financial timeseries data, built on FoundationDB with simplified SQL layer
Stars: ✭ 144 (+1007.69%)
Mutual labels:  market-data
intrinio-realtime-java-sdk
Intrinio Java SDK for Real-Time Stock Prices
Stars: ✭ 22 (+69.23%)
Mutual labels:  market-data
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (+1730.77%)
Mutual labels:  market-data
Krypto Trading Bot
Self-hosted crypto trading bot (automated high frequency market making) written in C++
Stars: ✭ 2,589 (+19815.38%)
Mutual labels:  market-data

QuantPlus_Api_Python

项目名称 Quant量化系统平台 研发单位
文档名称 QuantBaseApi python开发手册 项目版本 beta5.2.1
文档状态 编辑中 发布日期 2018.12.21
文档编辑 杨军辉、王龙 文档版本 1.0

项目主页

QuantPlus_Api_Python 是QuantPlus团队根据多年国内二级市场上的量化交易经验,将底层量化接口开放出来的一个产品。旨在为国内二级市场的量化开发者在数据、算法、交易等方面提供全面支持。目前已开放上证、深圳、中金所三个市场的level2深度行情数据、常用技术分析指标库、普通股票交易、融资融券交易的接口,不久后将开放个股期权交易接口的使用。

QuantPlus_Api 不仅仅是一个高速行情和整合了多家券商柜台的交易接口,还是 QuantPlus 匡益量化平台的入口。通过它量化开发者可以方便的构建自己的自动交易策略、信号提醒工具、甚至自己构建一个类似同花顺、大智慧的行情交易软件。

QuantPlus_Api_Python 是 QuantPlus_Api 接口的 Python 实现

安装方法

你可以通过在以下 [地址] 下载最新的版本,其中提供了如下版本

Window版本

linux版本

下载完成后解压至任意目录下。其中,windows版本的目录结构如下

├─QuantBaseApi
	├─__init__.py
	├─boost_python-vc120-mt-1_64.dll
	├─msvcp120.dll
	├─msvcp120d.dll
	├─msvcr120.dll
	├─msvcr120d.dll
	├─PT_MarketDataApi.dll
	├─PT_QuantApi.dll
	├─PT_QuantApi_Python27.pyd
	└─PT_TradeDataApi.dll
└─demo.py

linux 版本目录结构如下

├─QuantBaseApi
	├─__init__.py
	├─libboost_chrono.so.1.64.0
	├─libboost_context.so.1.64.0
	├─libboost_coroutine.so.1.64.0
	├─libboost_date_time.so.1.64.0
	├─libboost_filesystem.so.1.64.0
	├─libboost_locale.so.1.64.0
	├─libboost_python.so.1.64.0
	├─libboost_system.so.1.64.0
	├─libboost_thread.so.1.64.0
	├─libprotobuf.so.13
	├─libPT_MarketDataApi.so
	├─libPT_QuantApi.so
	├─libPT_TradeDataApi.so
	├─libPTNetwork.so
	├─libsnappy.so.1
	└─PT_QuantApi_Python27.so
└─demo.py

将QuantBaseApi目录下所有so文件拷贝到系统默认路径下,或者自行添加环境变量即可

快速开始

我们创建一个简单的订阅平安银行的历史level2行情数据的demo

demo.py

#encoding:utf-8

from QuantBaseApi import QuantCallBack,PT_QuantApi_Python36

class DataCallBack(QuantCallBack):
    def __init__(self):
        super(DataCallBack, self).__init__()
        self.api = PT_QuantApi_Python36.PT_QuantApi(self, True, "Td_Real", "MD_Real")  
    def OnConnect(self, type):
        print("OnConnnect:", type)
        if type == 2: 
            self.api.ReqSubQuote(1, ["market"], [""], ["000001.SZ"], "2016-07-17 8:30:00", "2017-11-06 24:00:00")
        pass
    def OnDisconnect(self, type):
        print("OnDisconnect:", type)
        pass
    def OnRtnUserInfo(self, pInfo):
        print ("OnRtnUserInfo", pInfo)
        pass
    def OnRtnLoginWarn(self, pInfo):
        print ("OnRtnLoginWarn", pInfo)
        pass
    def OnRtnDayBegin(self, nReqId, pDate):
        print ("OnRtnDayBegin ", pDate)
        pass
    def OnRtnDayEnd(self, nReqId, pDate):
        print ("OnRtnDayEnd ", pDate)
        pass
    def OnRtnMarket(self, pMarket):
        print ("OnRtnMarket ", pMarket)
        pass
    def OnRtnTransaction(self, pTransaction):
        print ("OnRtnTransaction ", pTransaction)
        pass
        
def main():
    mspi = DataCallBack()
    mapi = mspi.api
    PT_QuantApi_Python36.Init()
    #print mapi.GetErrMsg(3)
    #print mapi.getVersion()
    retLog = mapi.Login("DevTest1", "abcd1234")
    print("QuantPlus Login :", retLog)#打印登录返回码
    mapi.Run()

if __name__ == '__main__':
    main()

文档 详情

整个 QuantPlus_BaseApi 提供了2个模块

GetDataCallBack 详情

回调模块,所有信息的推送都是这个类,这个类提供了不同的数据回调函数,需要通过继承->重载的方式来实现策略的编写

QuantPlusApi 详情

主动请求接口,提供了具体和交易服务器,行情服务器通信,撮合引擎的通信,账户验证等功能的封装。

示例

以下提供了几个具体业务场景下的代码使用示例

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