diff --git a/vnpy/trader/app/ctaStrategy/ctaTemplate.py b/vnpy/trader/app/ctaStrategy/ctaTemplate.py index 5ff2031a..ace4a325 100644 --- a/vnpy/trader/app/ctaStrategy/ctaTemplate.py +++ b/vnpy/trader/app/ctaStrategy/ctaTemplate.py @@ -283,11 +283,11 @@ class TargetPosTemplate(CtaTemplate): if self.lastTick: if posChange > 0: longPrice = self.lastTick.askPrice1 + self.tickAdd - if tick.upperLimit: + if self.lastTick.upperLimit: longPrice = min(longPrice, self.lastTick.upperLimit) # 涨停价检查 else: shortPrice = self.lastTick.bidPrice1 - self.tickAdd - if tick.lowerLimit: + if self.lastTick.lowerLimit: shortPrice = max(shortPrice, self.lastTick.lowerLimit) # 跌停价检查 else: if posChange > 0: