typo & error in kk strategy
This commit is contained in:
parent
05212ea91e
commit
f12445f88b
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user