Merge pull request #199 from sexyfrog/dev
测试了ib接口香港期货交易所期货品种的行情及交易接口,添加对应数据字典、接口参数支持
This commit is contained in:
commit
4bff52823c
@ -46,6 +46,8 @@ exchangeMap[EXCHANGE_SMART] = 'SMART'
|
|||||||
exchangeMap[EXCHANGE_NYMEX] = 'NYMEX'
|
exchangeMap[EXCHANGE_NYMEX] = 'NYMEX'
|
||||||
exchangeMap[EXCHANGE_GLOBEX] = 'GLOBEX'
|
exchangeMap[EXCHANGE_GLOBEX] = 'GLOBEX'
|
||||||
exchangeMap[EXCHANGE_IDEALPRO] = 'IDEALPRO'
|
exchangeMap[EXCHANGE_IDEALPRO] = 'IDEALPRO'
|
||||||
|
exchangeMap[EXCHANGE_HKEX] = 'HKEX'
|
||||||
|
exchangeMap[EXCHANGE_HKFE] = 'HKFE'
|
||||||
exchangeMapReverse = {v:k for k,v in exchangeMap.items()}
|
exchangeMapReverse = {v:k for k,v in exchangeMap.items()}
|
||||||
|
|
||||||
# 报单状态映射
|
# 报单状态映射
|
||||||
@ -65,6 +67,7 @@ productClassMap[PRODUCT_EQUITY] = 'STK'
|
|||||||
productClassMap[PRODUCT_FUTURES] = 'FUT'
|
productClassMap[PRODUCT_FUTURES] = 'FUT'
|
||||||
productClassMap[PRODUCT_OPTION] = 'OPT'
|
productClassMap[PRODUCT_OPTION] = 'OPT'
|
||||||
productClassMap[PRODUCT_FOREX] = 'CASH'
|
productClassMap[PRODUCT_FOREX] = 'CASH'
|
||||||
|
productClassMap[PRODUCT_INDEX] = 'IND'
|
||||||
productClassMapReverse = {v:k for k,v in productClassMap.items()}
|
productClassMapReverse = {v:k for k,v in productClassMap.items()}
|
||||||
|
|
||||||
# 期权类型映射
|
# 期权类型映射
|
||||||
@ -77,6 +80,7 @@ optionTypeMap = {v:k for k,v in optionTypeMap.items()}
|
|||||||
currencyMap = {}
|
currencyMap = {}
|
||||||
currencyMap[CURRENCY_USD] = 'USD'
|
currencyMap[CURRENCY_USD] = 'USD'
|
||||||
currencyMap[CURRENCY_CNY] = 'CNY'
|
currencyMap[CURRENCY_CNY] = 'CNY'
|
||||||
|
currencyMap[CURRENCY_HKD] = 'HKD'
|
||||||
currencyMap = {v:k for k,v in currencyMap.items()}
|
currencyMap = {v:k for k,v in currencyMap.items()}
|
||||||
|
|
||||||
# Tick数据的Field和名称映射
|
# Tick数据的Field和名称映射
|
||||||
@ -230,6 +234,8 @@ class IbGateway(VtGateway):
|
|||||||
contract.expiry = orderReq.expiry
|
contract.expiry = orderReq.expiry
|
||||||
contract.strike = orderReq.strikePrice
|
contract.strike = orderReq.strikePrice
|
||||||
contract.right = optionTypeMap.get(orderReq.optionType, '')
|
contract.right = optionTypeMap.get(orderReq.optionType, '')
|
||||||
|
contract.lastTradeDateOrContractMonth = str(orderReq.lastTradeDateOrContractMonth)
|
||||||
|
contract.multiplier = str(orderReq.multiplier)
|
||||||
|
|
||||||
# 创建委托对象
|
# 创建委托对象
|
||||||
order = Order()
|
order = Order()
|
||||||
|
@ -654,6 +654,7 @@ class TradingWidget(QtGui.QFrame):
|
|||||||
EXCHANGE_SZSE,
|
EXCHANGE_SZSE,
|
||||||
EXCHANGE_SGE,
|
EXCHANGE_SGE,
|
||||||
EXCHANGE_HKEX,
|
EXCHANGE_HKEX,
|
||||||
|
EXCHANGE_HKFE,
|
||||||
EXCHANGE_SMART,
|
EXCHANGE_SMART,
|
||||||
EXCHANGE_ICE,
|
EXCHANGE_ICE,
|
||||||
EXCHANGE_CME,
|
EXCHANGE_CME,
|
||||||
@ -663,6 +664,7 @@ class TradingWidget(QtGui.QFrame):
|
|||||||
|
|
||||||
currencyList = [CURRENCY_NONE,
|
currencyList = [CURRENCY_NONE,
|
||||||
CURRENCY_CNY,
|
CURRENCY_CNY,
|
||||||
|
CURRENCY_HKD,
|
||||||
CURRENCY_USD]
|
CURRENCY_USD]
|
||||||
|
|
||||||
productClassList = [PRODUCT_NONE,
|
productClassList = [PRODUCT_NONE,
|
||||||
|
@ -62,6 +62,7 @@ EXCHANGE_SGE = 'SGE' # 上金所
|
|||||||
EXCHANGE_UNKNOWN = 'UNKNOWN'# 未知交易所
|
EXCHANGE_UNKNOWN = 'UNKNOWN'# 未知交易所
|
||||||
EXCHANGE_NONE = '' # 空交易所
|
EXCHANGE_NONE = '' # 空交易所
|
||||||
EXCHANGE_HKEX = 'HKEX' # 港交所
|
EXCHANGE_HKEX = 'HKEX' # 港交所
|
||||||
|
EXCHANGE_HKFE = 'HKFE' # 香港期货交易所
|
||||||
|
|
||||||
EXCHANGE_SMART = 'SMART' # IB智能路由(股票、期权)
|
EXCHANGE_SMART = 'SMART' # IB智能路由(股票、期权)
|
||||||
EXCHANGE_NYMEX = 'NYMEX' # IB 期货
|
EXCHANGE_NYMEX = 'NYMEX' # IB 期货
|
||||||
@ -77,5 +78,6 @@ EXCHANGE_OKCOIN = 'OKCOIN' # OKCOIN比特币交易所
|
|||||||
# 货币类型
|
# 货币类型
|
||||||
CURRENCY_USD = 'USD' # 美元
|
CURRENCY_USD = 'USD' # 美元
|
||||||
CURRENCY_CNY = 'CNY' # 人民币
|
CURRENCY_CNY = 'CNY' # 人民币
|
||||||
|
CURRENCY_HKD = 'HKD' # 港币
|
||||||
CURRENCY_UNKNOWN = 'UNKNOWN' # 未知货币
|
CURRENCY_UNKNOWN = 'UNKNOWN' # 未知货币
|
||||||
CURRENCY_NONE = '' # 空货币
|
CURRENCY_NONE = '' # 空货币
|
@ -412,6 +412,8 @@ class VtOrderReq(object):
|
|||||||
self.expiry = EMPTY_STRING # 到期日
|
self.expiry = EMPTY_STRING # 到期日
|
||||||
self.strikePrice = EMPTY_FLOAT # 行权价
|
self.strikePrice = EMPTY_FLOAT # 行权价
|
||||||
self.optionType = EMPTY_UNICODE # 期权类型
|
self.optionType = EMPTY_UNICODE # 期权类型
|
||||||
|
self.lastTradeDateOrContractMonth = EMPTY_STRING # 合约月,IB专用
|
||||||
|
self.multiplier = EMPTY_STRING # 乘数,IB专用
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user