基于VNPY进行功能增强
Project description
quant vnpy
一、 简介
1. 功能简介
本工具包是基于vnpy的回测库的一些增强函数
- quant_vnpy 目录包含各种增强函数及类库
- strategies 为策略库
2. 版本历史
2020-12-18 v0.3.9
fix: orm close connection feat: position daily stat.
2020-12-16 v0.3.7
add CrossLimitMethod.fix_price for backtest add quant_vnpy.backtest.cta_strategy.template.CtaTemplate backtest cross price method
2020-12-14 v0.3.2
add position monitor
2020-12-11 v0.2.16
on_tick active on_bar by bg on template.py add OrderDataCollector, TradeDataCollector class add stop_if_pos_2_0 on cta template bug fix of on_tick and report error
2020-12-04 v0.2.8
more readable log
2020-11-30 v0.2.7
orm add symbols
2020-11-27 v0.2.3
bug fix on log format
2020-11-25 v0.2.2
bug fix on on_stop of portfolio template
2020-11-25 v0.2.1
add strategy status monitor
2020-11-24 v0.1.10
add bar_count
2020-11-20 v0.1.8
bug fix on portfolio's template
2020-11-17 v0.1.7
对 cta 及 portfolio 增加 template 模板类 signal 增加 0 判断 当 0 时,默认为 default 值 add current_bar for cta, portfolio's template classes fix template bugs
2020-11-15 v0.1.2
最新依赖版本 IBATS_Common>=0.20.8,最新支持道 vnpy 2.1.7 版本 调整 INSTRUMENT_TRADE_TIME_PAIR_DIC 道 constants.py
2020-11-10 v0.1.0
基于vnpy 2.1.6进行的功能增强。此前版本不支持。
二、 环境设置及组件安装(首次运行前需要)
1. 系统环境包含 Anaconda 或 Miniconda(python 3.7 版本)
2. 安装 vnpy 2.1.6或以上版本 \
3. 运行按照相关组件
pip isntall -r requirement.txt
conda install -c plotly plotly-orca
conda install -c plotly python-kaleido
如果执行遇到问题可分别执行如下:
-
通用组件
pip install -r requirement.txt
-
orca 组件 orca 组件为回测功能中保存回测视图结果的组件,windows系统性需要单独安装,才可保证功能正常使用
安装步骤如下:-
安装组件包
conda install -c plotly plotly-orca
-
下载并安装 orca 应用
组件下载地址:orca组件
安装后设置话就环境变了 Path 加入相应路径,默认情况下window10操作系统 orca 组件将被安装在如下路径:
C:\Users\mmmaaaggg\AppData\Local\Programs\orca
- 批量关闭 orca 进程方法
ps -ef | grep orca | grep -v grep | awk '{print $2}' | xargs kill -9
-
-
MD文件转word文档工具
到pandoc官网下载对应的软件并按照后即可运行 Scripts\md_2_docx.bat 脚本
三、 常用命令
-
切换远程仓库地址方法
>git remote origin >git remote get-url --all origin git@192.168.10.117:quant/quant_vnpy.git >git remote set-url origin http://209386rt46.51vip.biz:23987/quant/quant_vnpy.git >git pull Username for 'http://209386rt46.51vip.biz:23987': Username for 'http://209386rt46.51vip.biz:23987': maguo Password for 'http://maguo@209386rt46.51vip.biz:23987': remote: Enumerating objects: 8, done. remote: Counting objects: 25% (2/8) remote: Counting objects: 100% (8/8), done. remote: Total 72 (delta 8), reused 8 (delta 8), pack-reused 64 Unpacking objects: 6% (5/72)Unpacking objects: 18% (13/72)Unpacking objects: 23% (17/72)Unpacking objects: 29% (21/72)Unpacking objects: 34% (25/72)Unpacking objects: 38% (28/72)Unpacking objects: 41% (30/72)Unpacking objects: 43% (31/72)Unpacking objects: 44% (32/72)Unpacking objects: 47% (34/72)Unpacking objects: 50% (36/72)Unpacking objects: 56% (41/72)Unpacking objects: 59% (43/72)Unpacking objects: 62% (45/72)Unpacking objects: 70% (51/72)Unpacking objects: 76% (55/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 80% (58/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 84% (61/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 88% (64/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 90% (65/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 94% (68/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 97% (70/72), 13.34 KiB | 26.00 KiB/sUnpacking objects: 100% (72/72), 17.93 KiB | 23.00 KiB/s, done. From http://209386rt46.51vip.biz:23987/quant/From http://209386rt46.51vip.biz:23987/quant/quant_vnpy cb6c014..1afe166 master -> origin/master Updating cb6c014..1afe166 Fast-forward README.md | 7 + ... 8 files changed, 404 insertions(+), 106 deletions(-) create mode 100644 strategies/trandition/period_resonance_dynamic/macd_kdj.py
-
数据库 dump 数据
"c:\Program Files\MySQL\MySQL Server 8.0\bin\mysqldump.exe" -u mg -p --databases vnpy dbbardata --where="symbol in ('rb9999', 'hc9999', 'i9999') and `interval`='1m'" > dbbardata_dump.sql
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for quant_vnpy-0.3.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 387156040a2250ff9ca51cc20a55526924fa9bf18ca6eb6cca2977eb3004aed4 |
|
MD5 | dff9683ca7f06c2310e25ad8221389de |
|
BLAKE2b-256 | 8a5a76340f9ee270eda5b6bada38fa040571dab6686edde0d0cdc92d4d8362ad |