typo & error in kk strategy
This commit is contained in:
parent
05212ea91e
commit
f12445f88b
@ -91,7 +91,7 @@ class CtaEngine(object):
|
|||||||
req = VtOrderReq()
|
req = VtOrderReq()
|
||||||
req.symbol = contract.symbol
|
req.symbol = contract.symbol
|
||||||
req.exchange = contract.exchange
|
req.exchange = contract.exchange
|
||||||
req.price = self.roundToPrickTick(contract.priceTick, price)
|
req.price = self.roundToPriceTick(contract.priceTick, price)
|
||||||
req.volume = volume
|
req.volume = volume
|
||||||
|
|
||||||
req.productClass = strategy.productClass
|
req.productClass = strategy.productClass
|
||||||
@ -574,7 +574,7 @@ class CtaEngine(object):
|
|||||||
strategy.pos = d['pos']
|
strategy.pos = d['pos']
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def roundToPrickTick(self, priceTick, price):
|
def roundToPriceTick(self, priceTick, price):
|
||||||
"""取整价格到合约最小价格变动"""
|
"""取整价格到合约最小价格变动"""
|
||||||
if not priceTick:
|
if not priceTick:
|
||||||
return price
|
return price
|
||||||
|
@ -228,7 +228,7 @@ class KkStrategy(CtaTemplate):
|
|||||||
self.intraTradeHigh = bar.high
|
self.intraTradeHigh = bar.high
|
||||||
self.intraTradeLow = min(self.intraTradeLow, bar.low)
|
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)
|
abs(self.pos), True)
|
||||||
self.orderList.append(orderID)
|
self.orderList.append(orderID)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user