This commit is contained in:
vn.py 2019-11-14 12:24:51 +08:00
parent 1351496280
commit 6015edcb73
3 changed files with 1019 additions and 471 deletions

File diff suppressed because one or more lines are too long

View File

@ -94,6 +94,8 @@ class StatisticalArbitrageStrategy(SpreadStrategyTemplate):
""" """
Callback when spread bar data is generated. Callback when spread bar data is generated.
""" """
self.stop_all_algos()
self.am.update_bar(bar) self.am.update_bar(bar)
if not self.am.inited: if not self.am.inited:
return return

View File

@ -547,7 +547,7 @@ class SpreadStrategyTemplate:
def stop_all_algos(self): def stop_all_algos(self):
"""""" """"""
for algoid in self.algoids: for algoid in list(self.algoids):
self.stop_algo(algoid) self.stop_algo(algoid)
def buy(self, vt_symbol: str, price: float, volume: float, lock: bool = False) -> List[str]: def buy(self, vt_symbol: str, price: float, volume: float, lock: bool = False) -> List[str]: