This commit is contained in:
vn.py 2018-03-12 09:42:40 +08:00
parent 9e71df1ebd
commit 0de9573759

View File

@ -283,11 +283,11 @@ class TargetPosTemplate(CtaTemplate):
if self.lastTick: if self.lastTick:
if posChange > 0: if posChange > 0:
longPrice = self.lastTick.askPrice1 + self.tickAdd longPrice = self.lastTick.askPrice1 + self.tickAdd
if tick.upperLimit: if self.lastTick.upperLimit:
longPrice = min(longPrice, self.lastTick.upperLimit) # 涨停价检查 longPrice = min(longPrice, self.lastTick.upperLimit) # 涨停价检查
else: else:
shortPrice = self.lastTick.bidPrice1 - self.tickAdd shortPrice = self.lastTick.bidPrice1 - self.tickAdd
if tick.lowerLimit: if self.lastTick.lowerLimit:
shortPrice = max(shortPrice, self.lastTick.lowerLimit) # 跌停价检查 shortPrice = max(shortPrice, self.lastTick.lowerLimit) # 跌停价检查
else: else:
if posChange > 0: if posChange > 0: