1. 增加国际能源交易中心

2. 解决ctpGateway的onRspQryInvestorPostion的持仓数据为空过滤问题
This commit is contained in:
chenxy123 2017-04-14 22:51:55 +08:00
parent a86c586281
commit 6b4bd355d6
4 changed files with 9 additions and 4 deletions

View File

@ -10,13 +10,12 @@
"""
import talib
import numpy as np
from ctaBase import *
from ctaTemplate import CtaTemplate
import talib
import numpy as np
########################################################################
class AtrRsiStrategy(CtaTemplate):

View File

@ -48,6 +48,7 @@ exchangeMap[EXCHANGE_SHFE] = 'SHFE'
exchangeMap[EXCHANGE_CZCE] = 'CZCE'
exchangeMap[EXCHANGE_DCE] = 'DCE'
exchangeMap[EXCHANGE_SSE] = 'SSE'
exchangeMap[EXCHANGE_INE] = 'INE'
exchangeMap[EXCHANGE_UNKNOWN] = ''
exchangeMapReverse = {v:k for k,v in exchangeMap.items()}
@ -683,7 +684,10 @@ class CtpTdApi(TdApi):
#----------------------------------------------------------------------
def onRspQryInvestorPosition(self, data, error, n, last):
"""持仓查询回报"""
"""持仓查询回报"""
if not data['InstrumentID']:
return
# 获取持仓缓存对象
posName = '.'.join([data['InstrumentID'], data['PosiDirection']])
if posName in self.posDict:

View File

@ -60,6 +60,7 @@ EXCHANGE_SHFE = 'SHFE' # 上期所
EXCHANGE_CZCE = 'CZCE' # 郑商所
EXCHANGE_DCE = 'DCE' # 大商所
EXCHANGE_SGE = 'SGE' # 上金所
EXCHANGE_INE = 'INE' # 国际能源交易中心
EXCHANGE_UNKNOWN = 'UNKNOWN'# 未知交易所
EXCHANGE_NONE = '' # 空交易所
EXCHANGE_HKEX = 'HKEX' # 港交所

View File

@ -60,6 +60,7 @@ EXCHANGE_SHFE = 'SHFE' # 上期所
EXCHANGE_CZCE = 'CZCE' # 郑商所
EXCHANGE_DCE = 'DCE' # 大商所
EXCHANGE_SGE = 'SGE' # 上金所
EXCHANGE_INE = 'INE' # 国际能源交易中心
EXCHANGE_UNKNOWN = 'UNKNOWN'# 未知交易所
EXCHANGE_NONE = '' # 空交易所
EXCHANGE_HKEX = 'HKEX' # 港交所