[Add]添加OptionMaster下的CTP证券接口ctpsecGateway
This commit is contained in:
parent
e7b56439f9
commit
f67cb40864
7
examples/OptionMaster/CTPSEC_connect.json
Normal file
7
examples/OptionMaster/CTPSEC_connect.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"brokerID": "2001",
|
||||
"mdAddress": "tcp://125.64.36.26:51213",
|
||||
"tdAddress": "tcp://125.64.36.26:51205",
|
||||
"userID": "请联系经纪商申请",
|
||||
"password": "请联系经纪商申请"
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"brokerID": "9999",
|
||||
"mdAddress": "tcp://180.168.146.187:10011",
|
||||
"tdAddress": "tcp://180.168.146.187:10001",
|
||||
"userID": "simnow申请",
|
||||
"password": "simnow申请"
|
||||
"brokerID": "2001",
|
||||
"mdAddress": "tcp://125.64.36.26:51213",
|
||||
"tdAddress": "tcp://125.64.36.26:51205",
|
||||
"userID": "请联系经纪商申请",
|
||||
"password": "请联系经纪商申请"
|
||||
}
|
10
examples/OptionMaster/ctpsecGateway/__init__.py
Normal file
10
examples/OptionMaster/ctpsecGateway/__init__.py
Normal 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
|
@ -1 +0,0 @@
|
||||
tBr8RMewRABqiW7HBOkrkg==
|
@ -18,6 +18,8 @@ from vnpy.trader.uiMainWindow import MainWindow
|
||||
# 加载底层接口
|
||||
from vnpy.trader.gateway import (secGateway, ctpGateway)
|
||||
|
||||
import ctpsecGateway
|
||||
|
||||
# 加载上层应用
|
||||
from vnpy.trader.app import (riskManager, optionMaster)
|
||||
|
||||
@ -37,6 +39,7 @@ def main():
|
||||
# 添加交易接口
|
||||
me.addGateway(secGateway)
|
||||
me.addGateway(ctpGateway)
|
||||
me.addGateway(ctpsecGateway)
|
||||
|
||||
# 添加上层应用
|
||||
me.addApp(riskManager)
|
||||
|
@ -48,6 +48,7 @@ exchangeMap[EXCHANGE_SHFE] = 'SHFE'
|
||||
exchangeMap[EXCHANGE_CZCE] = 'CZCE'
|
||||
exchangeMap[EXCHANGE_DCE] = 'DCE'
|
||||
exchangeMap[EXCHANGE_SSE] = 'SSE'
|
||||
exchangeMap[EXCHANGE_SZSE] = 'SZSE'
|
||||
exchangeMap[EXCHANGE_INE] = 'INE'
|
||||
exchangeMap[EXCHANGE_UNKNOWN] = ''
|
||||
exchangeMapReverse = {v:k for k,v in exchangeMap.items()}
|
||||
|
Loading…
Reference in New Issue
Block a user