From 0de9573759d749768171121be5cc4d7942762768 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Mon, 12 Mar 2018 09:42:40 +0800 Subject: [PATCH] [Fix]Close #778 --- vnpy/trader/app/ctaStrategy/ctaTemplate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: