typo & error in kk strategy

This commit is contained in:
hackerwei 2017-04-07 20:30:44 +08:00
parent 05212ea91e
commit f12445f88b
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ class CtaEngine(object):
req = VtOrderReq()
req.symbol = contract.symbol
req.exchange = contract.exchange
req.price = self.roundToPrickTick(contract.priceTick, price)
req.price = self.roundToPriceTick(contract.priceTick, price)
req.volume = volume
req.productClass = strategy.productClass
@ -574,7 +574,7 @@ class CtaEngine(object):
strategy.pos = d['pos']
#----------------------------------------------------------------------
def roundToPrickTick(self, priceTick, price):
def roundToPriceTick(self, priceTick, price):
"""取整价格到合约最小价格变动"""
if not priceTick:
return price

View File

@ -228,7 +228,7 @@ class KkStrategy(CtaTemplate):
self.intraTradeHigh = bar.high
self.intraTradeLow = min(self.intraTradeLow, bar.low)
orderID = self.buy(self.intraTradeLow*(1+self.trailingPrcnt/100),
orderID = self.cover(self.intraTradeLow*(1+self.trailingPrcnt/100),
abs(self.pos), True)
self.orderList.append(orderID)