From 8080adf87a31b55b5b5ccdfd42a3e7e5340c0303 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Mon, 8 Jun 2020 14:21:17 +0800 Subject: [PATCH] =?UTF-8?q?[bug=20fix]=20=E4=B8=8A=E8=83=BD=E6=BA=90?= =?UTF-8?q?=E6=89=80=E6=8C=87=E6=95=B0=E5=90=88=E7=BA=A6=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/app/index_tick_publisher/engine.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vnpy/app/index_tick_publisher/engine.py b/vnpy/app/index_tick_publisher/engine.py index ddfc4721..f231f166 100644 --- a/vnpy/app/index_tick_publisher/engine.py +++ b/vnpy/app/index_tick_publisher/engine.py @@ -387,11 +387,17 @@ class IndexTickPublisher(BaseEngine): else: tick_datetime = tick_datetime.replace(microsecond=0) + # 通达信上能源的交易所为上期所,需要改正过来 + if vn_symbol in ['NR99', 'SC99']: + exchange = Exchange.INE + else: + exchange = self.symbol_exchange_dict.get(tdx_symbol, Exchange.LOCAL) + tick = TickData( gateway_name='tdx', symbol=vn_symbol, datetime=tick_datetime, - exchange=self.symbol_exchange_dict.get(tdx_symbol, Exchange.LOCAL) + exchange=exchange ) tick.pre_close = float(d.get('ZuoJie', 0.0))