From 90682ab92d99525a8a1b2ed9d7c2a1463fc179b9 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 28 Mar 2019 11:11:29 +0800 Subject: [PATCH] [Fix]bugs in king keltner strategy --- vnpy/app/cta_strategy/strategies/king_keltner_strategy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnpy/app/cta_strategy/strategies/king_keltner_strategy.py b/vnpy/app/cta_strategy/strategies/king_keltner_strategy.py index 444ada5d..961e34e4 100644 --- a/vnpy/app/cta_strategy/strategies/king_keltner_strategy.py +++ b/vnpy/app/cta_strategy/strategies/king_keltner_strategy.py @@ -76,7 +76,7 @@ class KingKeltnerStrategy(CtaTemplate): """""" for orderid in self.vt_orderids: self.cancel_order(orderid) - self.vt_orderids = [] + self.vt_orderids.clear() am = self.am am.update_bar(bar) @@ -138,8 +138,8 @@ class KingKeltnerStrategy(CtaTemplate): self.long_vt_orderids = self.buy(buy_price, volume, True) self.short_vt_orderids = self.short(short_price, volume, True) - self.vt_orderids.append(self.long_vt_orderids) - self.vt_orderids.append(self.short_vt_orderids) + self.vt_orderids.extend(self.long_vt_orderids) + self.vt_orderids.extend(self.short_vt_orderids) def on_stop_order(self, stop_order: StopOrder): """