解决类变量重复赋值的Bug
This commit is contained in:
parent
feef63adfa
commit
2363583fc3
@ -32,8 +32,11 @@ class CtaTemplate(ABC):
|
|||||||
self.trading = False
|
self.trading = False
|
||||||
self.pos = 0
|
self.pos = 0
|
||||||
|
|
||||||
|
if "inited" not in self.variables:
|
||||||
self.variables.insert(0, "inited")
|
self.variables.insert(0, "inited")
|
||||||
|
if "trading" not in self.variables:
|
||||||
self.variables.insert(1, "trading")
|
self.variables.insert(1, "trading")
|
||||||
|
if "pos" not in self.variables:
|
||||||
self.variables.insert(2, "pos")
|
self.variables.insert(2, "pos")
|
||||||
|
|
||||||
self.update_setting(setting)
|
self.update_setting(setting)
|
||||||
|
Loading…
Reference in New Issue
Block a user