VeighNa量化社区
你的开源社区量化交易平台
catiglu's Avatar
Member
离线
24 帖子
声望: 2

建议vnpy增加以下两个功能模块:

1、数据接口购买
2、服务器一键购买和部署功能

让注重交易的人把更多的精力放在策略的打磨上。

安装环境:win10虚拟机vmware下ubuntu18.04,虚拟机内存4G

错误提示如下:

Generating locales (this might take a while)...
  zh_CN.GB18030...??????????"/usr/lib/locale/locale-archive": ????
 done
Generation complete.
Processing /home/lu/anaconda3/envs/vnpy/lib/python3.7/site-packages
    ERROR: Command errored out with exit status 1:
     command: /home/lu/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-_klkvgzo/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-_klkvgzo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-it7qwkfm
         cwd: /tmp/pip-req-build-_klkvgzo/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-_klkvgzo/setuptools/__init__.py", line 3, in <module>
        from fnmatch import fnmatchcase
      File "/home/lu/anaconda3/lib/python3.7/fnmatch.py", line 14, in <module>
        import re
      File "/home/lu/anaconda3/lib/python3.7/re.py", line 143, in <module>
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

在网上搜索“AttributeError: module 'enum' has no attribute 'IntFlag'”解决方法,是enmu34库不兼容导致,卸载enmu34后提示缺少pytz==2019.3、simplejson==3.17.0,安装这两个包以后重新bash install.sh又提示最上面的错误。始终不知问题原因所在,恳请高手给予指点!多谢

在相同条件下回测同一策略时,VN Station和backtesting_demo其他结果项目相同,除了总收益率和年化收益两项不一致,而且前者刚比后者刚好大一个数量级。具体结果如下图所示:
1、VN Station回测结果

description

2、backtesting_demo回测结果
description

具体回测环境:
VN Station版本2.5.2
backtesting_demo脚本从GitHub下载,具体脚本如下:

from vnpy.app.cta_strategy.backtesting import BacktestingEngine, OptimizationSetting
from vnpy.app.cta_strategy.strategies.nine_squire_strategy1 import (
NineSquireStrategy,
)
from datetime import datetime
engine = BacktestingEngine()
engine.set_parameters(
    vt_symbol="IF99.CFFEX",
    interval="1m",
    start=datetime(2015, 5, 7),
    end=datetime(2015, 8, 11),
    rate=0.25/10000,
    slippage=0.2,
    size=100,
    pricetick=0.2,
    capital=1000000,
)
engine.add_strategy(NineSquireStrategy, {})
engine.load_data()
engine.run_backtesting()
df = engine.calculate_result()
engine.calculate_statistics()
engine.show_chart()
© 2015-2022 微信 18391752892
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

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