This commit is contained in:
vn.py 2017-09-22 22:05:39 +08:00
parent fb8b404666
commit 9778e85480

View File

@ -470,13 +470,16 @@ class DataEngine(object):
# 设置持仓细节的委托转换模式
contract = self.getContract(vtSymbol)
if contract and contract.exchange is EXCHANGE_SHFE:
detail.mode = detail.MODE_SHFE
if contract:
# 上期所合约
if contract.exchange is EXCHANGE_SHFE:
detail.mode = detail.MODE_SHFE
# 检查是否有平今惩罚
for productID in self.tdPenaltyList:
if str(productID) in contract.symbol:
detail.mode = detail.MODE_TDPENALTY
for productID in self.tdPenaltyList:
if str(productID) in contract.symbol:
detail.mode = detail.MODE_TDPENALTY
return detail
#----------------------------------------------------------------------