This commit is contained in:
vn.py 2018-02-22 22:34:58 +08:00
parent 387332aee6
commit 6553a7084d

View File

@ -284,11 +284,11 @@ class TargetPosTemplate(CtaTemplate):
if posChange > 0: if posChange > 0:
longPrice = self.lastTick.askPrice1 + self.tickAdd longPrice = self.lastTick.askPrice1 + self.tickAdd
if tick.upperLimit: if tick.upperLimit:
longPrice = min(longPrice, tick.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 tick.lowerLimit:
shortPrice = max(shortPrice, tick.lowerLimit) # 跌停价检查 shortPrice = max(shortPrice, self.lastTick.lowerLimit) # 跌停价检查
else: else:
if posChange > 0: if posChange > 0:
longPrice = self.lastBar.close + self.tickAdd longPrice = self.lastBar.close + self.tickAdd