[Add]添加OptionMaster下的CTP证券接口ctpsecGateway

This commit is contained in:
vn.py 2017-12-05 13:24:33 +08:00
parent e7b56439f9
commit f67cb40864
6 changed files with 26 additions and 6 deletions

View File

@ -0,0 +1,7 @@
{
"brokerID": "2001",
"mdAddress": "tcp://125.64.36.26:51213",
"tdAddress": "tcp://125.64.36.26:51205",
"userID": "请联系经纪商申请",
"password": "请联系经纪商申请"
}

View File

@ -1,7 +1,7 @@
{ {
"brokerID": "9999", "brokerID": "2001",
"mdAddress": "tcp://180.168.146.187:10011", "mdAddress": "tcp://125.64.36.26:51213",
"tdAddress": "tcp://180.168.146.187:10001", "tdAddress": "tcp://125.64.36.26:51205",
"userID": "simnow申请", "userID": "请联系经纪商申请",
"password": "simnow申请" "password": "请联系经纪商申请"
} }

View File

@ -0,0 +1,10 @@
# encoding: UTF-8
from vnpy.trader import vtConstant
from vnpy.trader.gateway.ctpGateway import CtpGateway
gatewayClass = CtpGateway
gatewayName = 'CTPSEC'
gatewayDisplayName = 'CTP证券'
gatewayType = vtConstant.GATEWAYTYPE_FUTURES
gatewayQryEnabled = True

View File

@ -1 +0,0 @@
tBr8RMewRABqiW7HBOkrkg==

View File

@ -18,6 +18,8 @@ from vnpy.trader.uiMainWindow import MainWindow
# 加载底层接口 # 加载底层接口
from vnpy.trader.gateway import (secGateway, ctpGateway) from vnpy.trader.gateway import (secGateway, ctpGateway)
import ctpsecGateway
# 加载上层应用 # 加载上层应用
from vnpy.trader.app import (riskManager, optionMaster) from vnpy.trader.app import (riskManager, optionMaster)
@ -37,6 +39,7 @@ def main():
# 添加交易接口 # 添加交易接口
me.addGateway(secGateway) me.addGateway(secGateway)
me.addGateway(ctpGateway) me.addGateway(ctpGateway)
me.addGateway(ctpsecGateway)
# 添加上层应用 # 添加上层应用
me.addApp(riskManager) me.addApp(riskManager)

View File

@ -48,6 +48,7 @@ exchangeMap[EXCHANGE_SHFE] = 'SHFE'
exchangeMap[EXCHANGE_CZCE] = 'CZCE' exchangeMap[EXCHANGE_CZCE] = 'CZCE'
exchangeMap[EXCHANGE_DCE] = 'DCE' exchangeMap[EXCHANGE_DCE] = 'DCE'
exchangeMap[EXCHANGE_SSE] = 'SSE' exchangeMap[EXCHANGE_SSE] = 'SSE'
exchangeMap[EXCHANGE_SZSE] = 'SZSE'
exchangeMap[EXCHANGE_INE] = 'INE' exchangeMap[EXCHANGE_INE] = 'INE'
exchangeMap[EXCHANGE_UNKNOWN] = '' exchangeMap[EXCHANGE_UNKNOWN] = ''
exchangeMapReverse = {v:k for k,v in exchangeMap.items()} exchangeMapReverse = {v:k for k,v in exchangeMap.items()}