diff --git a/examples/OptionMaster/CTPSEC_connect.json b/examples/OptionMaster/CTPSEC_connect.json new file mode 100644 index 00000000..85eacb25 --- /dev/null +++ b/examples/OptionMaster/CTPSEC_connect.json @@ -0,0 +1,7 @@ +{ + "brokerID": "2001", + "mdAddress": "tcp://125.64.36.26:51213", + "tdAddress": "tcp://125.64.36.26:51205", + "userID": "请联系经纪商申请", + "password": "请联系经纪商申请" +} \ No newline at end of file diff --git a/examples/OptionMaster/CTP_connect.json b/examples/OptionMaster/CTP_connect.json index e4bfa6b8..85eacb25 100644 --- a/examples/OptionMaster/CTP_connect.json +++ b/examples/OptionMaster/CTP_connect.json @@ -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": "请联系经纪商申请" } \ No newline at end of file diff --git a/examples/OptionMaster/ctpsecGateway/__init__.py b/examples/OptionMaster/ctpsecGateway/__init__.py new file mode 100644 index 00000000..46b1e399 --- /dev/null +++ b/examples/OptionMaster/ctpsecGateway/__init__.py @@ -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 diff --git a/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat b/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat deleted file mode 100644 index dff3957f..00000000 --- a/examples/OptionMaster/data/TRADE_MARKET_110100001088sop.dat +++ /dev/null @@ -1 +0,0 @@ -tBr8RMewRABqiW7HBOkrkg== \ No newline at end of file diff --git a/examples/OptionMaster/run.py b/examples/OptionMaster/run.py index fac0164f..16926371 100644 --- a/examples/OptionMaster/run.py +++ b/examples/OptionMaster/run.py @@ -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) diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index 20f98c79..21f8c118 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -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()}