增加ctpGateway
This commit is contained in:
parent
6163af704f
commit
0a847db046
18
vn.trader/gateway/ctpGateway/__init__.py
Normal file
18
vn.trader/gateway/ctpGateway/__init__.py
Normal file
@ -0,0 +1,18 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
trader_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||
sys.path.append(trader_path)
|
||||
import vtConstant
|
||||
|
||||
print u'init {0}'.format(os.path.dirname(__file__))
|
||||
|
||||
from ctpGateway import CtpGateway as gateway
|
||||
|
||||
gatewayName = 'CTP'
|
||||
gatewayDisplayName = gatewayName
|
||||
gatewayType = vtConstant.GATEWAYTYPE_FUTURES
|
||||
gatewayQryEnabled = True
|
||||
|
6456
vn.trader/gateway/ctpGateway/ctpDataType.py
Normal file
6456
vn.trader/gateway/ctpGateway/ctpDataType.py
Normal file
File diff suppressed because it is too large
Load Diff
1531
vn.trader/gateway/ctpGateway/ctpGateway.py
Normal file
1531
vn.trader/gateway/ctpGateway/ctpGateway.py
Normal file
File diff suppressed because it is too large
Load Diff
25
vn.trader/gateway/ctpGateway/language/__init__.py
Normal file
25
vn.trader/gateway/ctpGateway/language/__init__.py
Normal file
@ -0,0 +1,25 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
import json
|
||||
import os
|
||||
import traceback
|
||||
|
||||
print u'init {0}'.format(os.path.dirname(__file__))
|
||||
|
||||
# 默认设置
|
||||
from chinese import text
|
||||
|
||||
# 获取目录上级路径
|
||||
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
|
||||
SETTING_FILENAME = 'VT_setting.json'
|
||||
SETTING_FILENAME = os.path.join(path, SETTING_FILENAME)
|
||||
|
||||
# 打开配置文件,读取语言配置
|
||||
try:
|
||||
f = file(SETTING_FILENAME)
|
||||
setting = json.load(f)
|
||||
if setting['language'] == 'english':
|
||||
from english import text
|
||||
f.close()
|
||||
except:
|
||||
traceback.print_exc()
|
18
vn.trader/gateway/ctpGateway/language/chinese/text.py
Normal file
18
vn.trader/gateway/ctpGateway/language/chinese/text.py
Normal file
@ -0,0 +1,18 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
LOADING_ERROR = u'读取连接配置出错,请检查'
|
||||
CONFIG_KEY_MISSING = u'连接配置缺少字段,请检查'
|
||||
|
||||
DATA_SERVER_CONNECTED = u'行情服务器连接成功'
|
||||
DATA_SERVER_DISCONNECTED = u'行情服务器连接断开'
|
||||
DATA_SERVER_LOGIN = u'行情服务器登录完成'
|
||||
DATA_SERVER_LOGOUT = u'行情服务器登出完成'
|
||||
|
||||
TRADING_SERVER_CONNECTED = u'交易服务器连接成功'
|
||||
TRADING_SERVER_DISCONNECTED = u'交易服务器连接断开'
|
||||
TRADING_SERVER_AUTHENTICATED = u'交易服务器验证成功'
|
||||
TRADING_SERVER_LOGIN = u'交易服务器登录完成'
|
||||
TRADING_SERVER_LOGOUT = u'交易服务器登出完成'
|
||||
|
||||
SETTLEMENT_INFO_CONFIRMED = u'结算信息确认完成'
|
||||
CONTRACT_DATA_RECEIVED = u'交易合约信息获取完成'
|
18
vn.trader/gateway/ctpGateway/language/english/text.py
Normal file
18
vn.trader/gateway/ctpGateway/language/english/text.py
Normal file
@ -0,0 +1,18 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
LOADING_ERROR = u'Error occurred when loading the config file, please check.'
|
||||
CONFIG_KEY_MISSING = u'Key missing in the config file, please check.'
|
||||
|
||||
DATA_SERVER_CONNECTED = u'Data server connected.'
|
||||
DATA_SERVER_DISCONNECTED = u'Data server disconnected'
|
||||
DATA_SERVER_LOGIN = u'Data server login completed.'
|
||||
DATA_SERVER_LOGOUT = u'Data server logout completed.'
|
||||
|
||||
TRADING_SERVER_CONNECTED = u'Trading server connected.'
|
||||
TRADING_SERVER_DISCONNECTED = u'Trading server disconnected.'
|
||||
TRADING_SERVER_AUTHENTICATED = u'Trading server authenticated.'
|
||||
TRADING_SERVER_LOGIN = u'Trading server login completed.'
|
||||
TRADING_SERVER_LOGOUT = u'Trading server logout completed.'
|
||||
|
||||
SETTLEMENT_INFO_CONFIRMED = u'Settlement info confirmed.'
|
||||
CONTRACT_DATA_RECEIVED = u'Contract data received.'
|
BIN
vn.trader/gateway/ctpGateway/thostmduserapi.dll
Normal file
BIN
vn.trader/gateway/ctpGateway/thostmduserapi.dll
Normal file
Binary file not shown.
BIN
vn.trader/gateway/ctpGateway/thosttraderapi.dll
Normal file
BIN
vn.trader/gateway/ctpGateway/thosttraderapi.dll
Normal file
Binary file not shown.
BIN
vn.trader/gateway/ctpGateway/vnctpmd.pyd
Normal file
BIN
vn.trader/gateway/ctpGateway/vnctpmd.pyd
Normal file
Binary file not shown.
BIN
vn.trader/gateway/ctpGateway/vnctpmd.so
Normal file
BIN
vn.trader/gateway/ctpGateway/vnctpmd.so
Normal file
Binary file not shown.
BIN
vn.trader/gateway/ctpGateway/vnctptd.pyd
Normal file
BIN
vn.trader/gateway/ctpGateway/vnctptd.pyd
Normal file
Binary file not shown.
BIN
vn.trader/gateway/ctpGateway/vnctptd.so
Normal file
BIN
vn.trader/gateway/ctpGateway/vnctptd.so
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user