图形化CTA策略回测模块,基于用户友好的图形界面实现简洁易用的数据下载、历史回测和参数优化等投研功能。
安装环境推荐基于3.7.0版本以上的【VeighNa Studio】。
直接使用pip命令:
pip install vnpy_ctabacktester
或者下载源代码后,解压后在cmd中运行:
pip install .
VeighNa框架的CTA回测模块
Home Page: https://www.vnpy.com
License: MIT License
图形化CTA策略回测模块,基于用户友好的图形界面实现简洁易用的数据下载、历史回测和参数优化等投研功能。
安装环境推荐基于3.7.0版本以上的【VeighNa Studio】。
直接使用pip命令:
pip install vnpy_ctabacktester
或者下载源代码后,解压后在cmd中运行:
pip install .
可能mac和windows的路径分隔符不一致,mac环境下会失败
需要修改/vnpy_ctabacktester/engine.py:95
的代码为
pathname: str = str(path) + f"/*.{suffix}"
希望作者兼容一下mac
The backtester gives the runtime error:
RuntimeWarning: divide by zero encountered in double_scalars
return_drawdown_ratio: float = -total_return / max_ddpercent
This is due to the max_ddpercent
may be 0 in some kind of trading.
We can just assign return_drawdown_ratio=0 if the max_ddpercent is 0. This can avoid runtime waning.
环境
操作系统: 如Windows 10 8G 内存 10400F的cpu 显卡1080ti
Python版本: 3.7
VeighNa版本: 3.3.0
Issue类型
三选一:Enhancement
预期程序行为
回放速度正常,UI不被卡住。
实际程序行为
实际行为: 50w数据量 点击回测 回放数据大概要30分钟 而且不能ui卡住 不能动弹,这个能优化下吗 缩短时间。UI不会被卡住啊
重现步骤
大概50w数据量 点击-开始回测 等待数据导入-等待数据回放 (因为数据量太大,卡住了 鼠标转圈,UI不能动)
在vnstation或者jupyter中使用遗传算法优化策略时,有概率会出现多进程和numpy问题。
self.chart: BacktesterChart = BacktesterChart() //pg.GraphicsLayoutWidget
chart: QtWidgets.QVBoxLayout = QtWidgets.QVBoxLayout()
chart.addWidget(self.chart)
TypeError("'PySide6.QtWidgets.QBoxLayout.addWidget' called with wrong argument types:\n PySide6.QtWidgets.QBoxLayout.addWidget(BacktesterChart)\nSupported signatures:\n PySide6.QtWidgets.QBoxLayout.addWidget(PySide6.QtWidgets.QWidget, int = 0, PySide6.QtCore.Qt.Alignment = Default(Qt.Alignment))")
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/vnpy/lib/python3.10/site-packages/vnpy_ctabacktester/ui/widget.py", line 406, in start_optimization
if i != dialog.Accepted:
AttributeError: 'OptimizationSettingEditor' object has no attribute 'Accepted'. Did you mean: 'accepted'?
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/vnpy/lib/python3.10/site-packages/vnpy_ctabacktester/ui/widget.py", line 406, in start_optimization
if i != dialog.Accepted:
AttributeError: 'OptimizationSettingEditor' object has no attribute 'Accepted'. Did you mean: 'accepted'?
qt.pointer.dispatch: skipping QEventPoint(id=1 ts=0 pos=0,0 scn=4549.06,697.076 gbl=4549.06,697.076 Released ellipse=(1x1 ∡ 0) vel=0,0 press=-4549.06,-697.076 last=-4549.06,-697.076 Δ 4549.06,697.076) : no target window
Macos 13.1
VNPY 3.5.0
根据1.0.9版本升级说明,应给是替换GraphicsWindow到 GraphicsLayoutWidget 以后的问题,不知道是不是mac上qt6的问题
实盘中,有两个回撤指标特别受关注
1、最长回撤时间
2、最大回撤对应的恢复时间
看是否有时间添加
另外,cta的单独回测或者组合回测的时候,能否显示仓位的杠杆率水平(或者仓位水平),时序的或者最大的杠杆率(仓位)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.