[Mod] rename variable

This commit is contained in:
vn.py 2019-07-02 14:57:26 +08:00
parent 6d9384c56b
commit 838727f015

View File

@ -94,17 +94,17 @@ class KingKeltnerStrategy(CtaTemplate):
self.intra_trade_high = max(self.intra_trade_high, bar.high_price)
self.intra_trade_low = bar.low_price
vt_orderid = self.sell(self.intra_trade_high * (1 - self.trailing_percent / 100),
abs(self.pos), True)
self.vt_orderids.extend(vt_orderid)
vt_orderids = self.sell(self.intra_trade_high * (1 - self.trailing_percent / 100),
abs(self.pos), True)
self.vt_orderids.extend(vt_orderids)
elif self.pos < 0:
self.intra_trade_high = bar.high_price
self.intra_trade_low = min(self.intra_trade_low, bar.low_price)
vt_orderid = self.cover(self.intra_trade_low * (1 + self.trailing_percent / 100),
abs(self.pos), True)
self.vt_orderids.extend(vt_orderid)
vt_orderids = self.cover(self.intra_trade_low * (1 + self.trailing_percent / 100),
abs(self.pos), True)
self.vt_orderids.extend(vt_orderids)
self.put_event()