VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 227
声望: 0

description

Member
avatar
加入于:
帖子: 13
声望: 0

你是找不到VNPY自建的类,还是找不到你自己写的类文件?

Member
avatar
加入于:
帖子: 4618
声望: 284

可以自己去vnpy_spredtrading.engine的load_strategy_class_from_module函数下打印排查看看

Member
avatar
加入于:
帖子: 227
声望: 0

杨光 wrote:

你是找不到VNPY自建的类,还是找不到你自己写的类文件?
找不到vnpy提供的案例模型

Member
avatar
加入于:
帖子: 227
声望: 0

xiaohe wrote:

可以自己去vnpy_spredtrading.engine的load_strategy_class_from_module函数下打印排查看看

以下为对函数进行的输出
def load_strategy_class_from_module(self, module_name: str):
"""
Load strategy class from module file.
"""
try:
module = importlib.import_module(module_name)
print('module ',module)
for name in dir(module):
value = getattr(module, name)
print('value',value)
if (isinstance(value, type) and issubclass(value, SpreadStrategyTemplate) and value is not SpreadStrategyTemplate):
print('xxxxxxxxx')
self.classes[value.name] = value

    except:  # noqa
        msg = f"策略文件{module_name}加载失败,触发异常:\n{traceback.format_exc()}"
        self.write_log(msg)

description

description

description

Member
avatar
加入于:
帖子: 716
声望: 62

看你的输出只有一个basic_spread_strategy,你是不是把statistical_arbitrage_strategy删了或者进行了修改

Member
avatar
加入于:
帖子: 227
声望: 0

没有修改 也没有删除

description
description

Member
avatar
加入于:
帖子: 13
声望: 0

逆火 wrote:

杨光 wrote:

你是找不到VNPY自建的类,还是找不到你自己写的类文件?
找不到vnpy提供的案例模型
以double_ma_strategy 为例
"\veighna_studio\Lib\site-packages\vnpy_ctastrategy\strategies\double_ma_strategy.py"

Member
avatar
加入于:
帖子: 227
声望: 0

已解决 对案例修改的时候 代码中有错误 导致的

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】