From 8dfc72591a6fcae1124040b32cd998dfa1b3367a Mon Sep 17 00:00:00 2001 From: 1122455801 Date: Tue, 6 Aug 2019 18:52:33 +0800 Subject: [PATCH 1/2] Update engine.py --- vnpy/app/cta_strategy/engine.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vnpy/app/cta_strategy/engine.py b/vnpy/app/cta_strategy/engine.py index 287a4a41..a1d9f5bd 100644 --- a/vnpy/app/cta_strategy/engine.py +++ b/vnpy/app/cta_strategy/engine.py @@ -755,7 +755,11 @@ class CtaEngine(BaseEngine): if filename.endswith(".py"): strategy_module_name = ".".join( [module_name, filename.replace(".py", "")]) - self.load_strategy_class_from_module(strategy_module_name) + elif filename.endswith(".pyd"): + strategy_module_name = ".".join( + [module_name, filename.replace(".pyd", "")]) + + self.load_strategy_class_from_module(strategy_module_name) def load_strategy_class_from_module(self, module_name: str): """ From b17a26b50891bcfd9511ce9578315aa36f9a4510 Mon Sep 17 00:00:00 2001 From: 1122455801 Date: Tue, 6 Aug 2019 20:02:16 +0800 Subject: [PATCH 2/2] Update engine.py --- vnpy/app/cta_strategy/engine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnpy/app/cta_strategy/engine.py b/vnpy/app/cta_strategy/engine.py index a1d9f5bd..76eda3d8 100644 --- a/vnpy/app/cta_strategy/engine.py +++ b/vnpy/app/cta_strategy/engine.py @@ -755,10 +755,10 @@ class CtaEngine(BaseEngine): if filename.endswith(".py"): strategy_module_name = ".".join( [module_name, filename.replace(".py", "")]) - elif filename.endswith(".pyd"): + elif filename.endswith(".cp37-win_amd64.pyd"): strategy_module_name = ".".join( - [module_name, filename.replace(".pyd", "")]) - + [module_name, filename.replace(".cp37-win_amd64.pyd", "")]) + self.load_strategy_class_from_module(strategy_module_name) def load_strategy_class_from_module(self, module_name: str):