From 8c6b926b821a6520bd8b189cd5205f8fa8750877 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Fri, 6 Nov 2020 21:55:54 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E8=B0=83=E6=95=B4=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8IP=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=93=81?= =?UTF-8?q?=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/data/tdx/tdx_common.py | 3 ++- vnpy/data/tdx/tdx_future_data.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vnpy/data/tdx/tdx_common.py b/vnpy/data/tdx/tdx_common.py index aa5fae10..ffc7d884 100644 --- a/vnpy/data/tdx/tdx_common.py +++ b/vnpy/data/tdx/tdx_common.py @@ -66,8 +66,9 @@ PERIOD_MAPPING['1month'] = 6 # 期货行情服务器清单 TDX_FUTURE_HOSTS = [ + #{"ip": "120.24.0.77", "port": 443, "name": "通达信接入主站"}, {"ip": "112.74.214.43", "port": 7727, "name": "扩展市场深圳双线1"}, - {"ip": "120.24.0.77", "port": 7727, "name": "扩展市场深圳双线2"}, + #{"ip": "120.24.0.77", "port": 7727, "name": "扩展市场深圳双线2"}, {"ip": "47.107.75.159", "port": 7727, "name": "扩展市场深圳双线3"}, {"ip": "113.105.142.136", "port": 443, "name": "扩展市场东莞主站"}, diff --git a/vnpy/data/tdx/tdx_future_data.py b/vnpy/data/tdx/tdx_future_data.py index dc31a428..1b19faef 100644 --- a/vnpy/data/tdx/tdx_future_data.py +++ b/vnpy/data/tdx/tdx_future_data.py @@ -70,7 +70,7 @@ INIT_TDX_MARKET_MAP = { 'CJL9': 28, 'CYL9': 28, 'FGL9': 28, 'JRL9': 28, 'LRL9': 28, 'MAL9': 28, 'OIL9': 28, 'PML9': 28, 'RIL9': 28, 'RML9': 28, 'RSL9': 28, 'SFL9': 28, 'SML9': 28, 'SRL9': 28, 'TAL9': 28, 'ICL9': 47, 'IFL9': 47, 'IHL9': 47, - 'TFL9': 47, 'TL9': 47, 'TSL9': 47} + 'TFL9': 47, 'TL9': 47, 'TSL9': 47, 'SAL9': 28, 'PGL9': 29, 'PFL9': 28,} # 常量 QSIZE = 500 ALL_MARKET_BEGIN_HOUR = 8 @@ -655,7 +655,9 @@ class TdxFutureData(object): q_size = QSIZE * 5 # 每秒 2个, 10小时 max_data_size = 1000000 - market_id = INIT_TDX_MARKET_MAP.get(tdx_index_symbol, 0) + market_id = INIT_TDX_MARKET_MAP.get(tdx_index_symbol, None) + if market_id is None: + raise Exception(f'{tdx_index_symbol}未在INIT_TDX_MARKET_MAP中定义交易所') self.write_log(u'开始下载{}=>{}, market_id={} 当日分笔数据'.format(symbol, tdx_index_symbol, market_id)) try: