openctp / webctp Goto Github PK
View Code? Open in Web Editor NEW将CTP接口转换成websocket+json协议对外通讯,适合web类应用。
Home Page: http://www.openctp.cn
License: BSD 3-Clause "New" or "Revised" License
将CTP接口转换成websocket+json协议对外通讯,适合web类应用。
Home Page: http://www.openctp.cn
License: BSD 3-Clause "New" or "Revised" License
期望为
{
"MsgType": "OnRspUnSubscribeMarketData",
"SpecificInstrument": {
"InstrumentID": "au2305"
},
"RspInfo": {
"ErrorID": 0,
"ErrorMsg": ""
},
"RequestID": 0,
"IsLast": true
}
实际是
{
"MsgType": "OnRspSubMarketData",
"RspInfo": {
"ErrorID": 0,
"ErrorMsg": "CTP:No Error"
},
"RequestID": 0,
"IsLast": true,
"SpecificInstrument": "ag2306"
}
删除调用函数的实时响应。
Requirements:
Now one connection(websocket) has one client(md/td).
If the same user login by multi clients, then server will create multi same clients which are repeated.
Can webctp avoid the repeated resources ?
相关issue #5
///请求查询交易所
virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0;
///请求查询产品
virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0;
///请求查询合约
virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0;
///请求查询行情
virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0;
///请求查询投资者持仓明细
virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0;
///请求查询交易所保证金率
virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0;
///请求查询报单手续费
virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, int nRequestID) = 0;
///请求查询期权交易成本
virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0;
///请求查询期权合约手续费
virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0;
请另外建一个issue说明在补充哪些API和SPI,新建的issue请引用本issue并在本issue下comment,然后把开发中的API和SPI填写在开发中一栏,merge以后再改到已有中。
相关issue #5
///请求查询成交
virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0;
///请求查询投资者持仓
virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0;
///请求查询资金账户
virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0;
///请求查询投资者
virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0;
///请求查询交易编码
virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0;
///请求查询合约保证金率
virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0;
///请求查询合约手续费率
virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0;
请另外建一个issue说明在补充哪些API和SPI,新建的issue请引用本issue并在本issue下comment,然后把开发中的API和SPI填写在开发中一栏,merge以后再改到已有中。
您好,
请问有没有可能在这个项目里用python做一个简单的demo? 最好包括登录,获取合约信息,获取用户信息之类的。
非常感谢
#22 继续修复该单里的bug和添加文档
目前响应是unicode,需要按utf-8进行编码。
能支持命名格式更好
关联单#5
///用户口令更新请求
virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0;
///报单录入请求
virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0;
///报单操作请求
virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0;
///查询最大报单数量请求
virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0;
///请求查询报单
virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0;
添加各个平台的启动脚本,方便一键启动分为如下几个脚本
# Windows
webctp_md.ps1 -c configure_file
webctp_td.ps1 -c configure_file
# Linux
webctp_md.sh -c configure_file
webctp_td.sh -c configure_file
# MacOS
webctp_md.sh -c configure_file
webctp_td.sh -c configure_file
参考vnpy中https://github.com/vnpy/vnpy_ctp/blob/main/vnpy_ctp/gateway/ctp_gateway.py#L326的adjust_price的处理逻辑
通过pip install webctp进行安装,用户可以引用webctp中的app进行自定义的启动。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.