[bug fix] 避免active_orders在多个实例间冲突

This commit is contained in:
msincenselee 2020-04-04 21:18:49 +08:00
parent a01bb7e735
commit a1faf9b27d
2 changed files with 2 additions and 1 deletions

View File

@ -50,6 +50,7 @@ class CtaTemplate(ABC):
self.entrust = 0 # 是否正在委托, 0, 无委托 , 1, 委托方向是LONG -1, 委托方向是SHORT self.entrust = 0 # 是否正在委托, 0, 无委托 , 1, 委托方向是LONG -1, 委托方向是SHORT
self.tick_dict = {} # 记录所有on_tick传入最新tick self.tick_dict = {} # 记录所有on_tick传入最新tick
self.active_orders = {}
# Copy a new variables list here to avoid duplicate insert when multiple # Copy a new variables list here to avoid duplicate insert when multiple
# strategy instances are created with the same strategy class. # strategy instances are created with the same strategy class.

View File

@ -51,7 +51,7 @@ class CtaTemplate(ABC):
self.entrust = 0 # 是否正在委托, 0, 无委托 , 1, 委托方向是LONG -1, 委托方向是SHORT self.entrust = 0 # 是否正在委托, 0, 无委托 , 1, 委托方向是LONG -1, 委托方向是SHORT
self.tick_dict = {} # 记录所有on_tick传入最新tick self.tick_dict = {} # 记录所有on_tick传入最新tick
self.active_orders = {}
# Copy a new variables list here to avoid duplicate insert when multiple # Copy a new variables list here to avoid duplicate insert when multiple
# strategy instances are created with the same strategy class. # strategy instances are created with the same strategy class.
self.variables = copy(self.variables) self.variables = copy(self.variables)