commit
afa898d9a8
@ -1 +1,10 @@
|
||||
# Introduction
|
||||
# 代码贡献说明
|
||||
|
||||
## Linter智能提示
|
||||
|
||||
|
||||
## 代码检查
|
||||
|
||||
|
||||
## 持续集成
|
||||
|
||||
|
46
docs/cta_backtester.md
Normal file
46
docs/cta_backtester.md
Normal file
@ -0,0 +1,46 @@
|
||||
# CTA回测模块
|
||||
CTA回测模块是基于PyQt5和pyqtgraph的图形化回测工具。启动VN Trader后,在菜单栏中点击“功能-> CTA回测”即可进入该图形化回测界面,如下图。CTA回测模块主要实现3个功能:历史行情数据的下载、策略回测、参数优化。
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/cta_backtester/cta_backtester.png)
|
||||
|
||||
|
||||
|
||||
|
||||
## 1.下载数据
|
||||
数据下载功能是基于RQData的get_price()函数实现的。
|
||||
```
|
||||
get_price(order_book_ids, start_date='2013-01-04', end_date='2014-01-04', frequency='1d', fields=None, adjust_type='pre', skip_suspended =False, market='cn')
|
||||
```
|
||||
|
||||
|
||||
在使用前要保证RQData初始化完毕,然后填写以下4个字段信息:
|
||||
- 本地代码:格式为合约品种+交易所,如IF88.CFFEX、rb88.SHFE;然后在底层通过RqdataClient的to_rq_symbol()函数转换成符合RQData格式,对应RQData中get_price()函数的order_book_ids字段。
|
||||
- K线周期:可以填1m、60m、1d,对应get_price()函数的frequency字段。
|
||||
- 开始日期:格式为yy/mm/dd,如2017/4/21,对应get_price()函数的start_date字段。(点击窗口右侧箭头按钮可改变日期大小)
|
||||
- 结束日期:格式为yy/mm/dd,如2019/4/22,对应get_price()函数的end_date字段。(点击窗口右侧箭头按钮可改变日期大小)
|
||||
|
||||
填写完字段信息后,点击下方“下载数据”按钮启动下载程序,下载成功如图所示。
|
||||
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/cta_backtester/data_loader.png)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 2.加载启动
|
||||
|
||||
|
||||
|
||||
|
||||
## 3.策略回测
|
||||
|
||||
### 3.1统计数据
|
||||
|
||||
|
||||
### 3.2图表分析
|
||||
|
||||
|
||||
|
||||
## 4.参数优化
|
||||
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
# 交易接口
|
||||
|
||||
## 如何连接
|
||||
|
||||
### 加载需要用的接口
|
||||
|
||||
|
||||
### VN Trader界面操作
|
||||
|
||||
|
||||
### 修改json配置文件
|
||||
|
||||
|
||||
### 可交易的合约查看
|
||||
|
||||
|
||||
## 接口分类
|
||||
|
||||
做一个表
|
||||
|
||||
|
||||
## 接口详解
|
||||
|
||||
### CTP(ctp)
|
||||
|
||||
#### 如何加载
|
||||
|
||||
#### 相关字段
|
||||
|
||||
#### 获取账号
|
||||
|
||||
#### 其他特点
|
||||
|
||||
|
||||
### 宽睿柜台(oes)
|
||||
|
||||
#### 如何加载
|
||||
|
||||
#### 相关字段
|
||||
|
||||
#### 获取账号
|
||||
|
||||
#### 其他特点
|
||||
|
||||
|
||||
### 盈透证券(ib)
|
||||
|
||||
### 老虎证券(tiger)
|
||||
|
||||
### OKEX
|
||||
|
||||
|
||||
### 火币
|
@ -19,7 +19,7 @@
|
||||
|
||||
注意事项:第4步会提示用户是否把VNConda注册成默认Python环境:若用户存在其他Python环境,则都不要勾选;反之,两个都勾选掉。
|
||||
|
||||
![enter image description here](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/install_VNConda.png "enter image title here")
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/install_VNConda.png "enter image title here")
|
||||
|
||||
|
||||
|
||||
@ -27,13 +27,13 @@
|
||||
|
||||
输入账号密码或者微信扫码登陆VNConda。(社区账号通过微信扫码可得)
|
||||
|
||||
![enter image description here](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/login_VNConda.png "enter image title here")
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/login_VNConda.png "enter image title here")
|
||||
|
||||
|
||||
|
||||
#### 4.使用VNStation
|
||||
登录后会进入到VN Station的主界面。
|
||||
![enter image description here](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/login_VNConda_2.png "enter image title here")
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/login_VNConda_2.png "enter image title here")
|
||||
|
||||
窗口下方有5个选项:
|
||||
- VN Trade Lite:直接运行VN Trader (只有CTP接口)
|
||||
@ -42,6 +42,17 @@
|
||||
- 提问求助:提出相关问题,管理员会每天定时回复
|
||||
- 后台更新:一键更新VN Station
|
||||
|
||||
|
||||
|
||||
|
||||
#### 5.更新VNStation
|
||||
更新VNStation除了“一键更新”外,也可以卸载老版本,安装新版本。
|
||||
|
||||
重新启动后,有几率会遇到下面的问题:“无法定位序数4540于动态链接库 \VNConda\Lib\site-packages\PyQt5\Qt\bin\ssleay.dll上。”类似的窗口弹出了几个,无法登录VN Station。
|
||||
|
||||
原因是操作系统中安装了其他的SSL组件,同时还影响了相关的环境变量,导致PyQt载入ssl模块失败。
|
||||
解决方法是将 \VNConda\Lib\site-packages\PyQt5\Qt\bin 目录的两个动态库 libeay32.dll和 ssleay32.dll拷贝到 \VNConda\ 下。
|
||||
|
||||
|
||||
|
||||
|
||||
@ -94,13 +105,13 @@ $ bash Miniconda3-latest-Linux-x86_64.sh
|
||||
|
||||
当询问是否把Miniconda设置为Python 默认环境时,把默认的"no"改成“yes”。原因是Ubuntu 18.04已有自带的Python 3.6与Python 2.7。
|
||||
|
||||
![enter image description here](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/install_Miniconda_ubuntu.png "enter image title here")
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/install_Miniconda_ubuntu.png "enter image title here")
|
||||
|
||||
|
||||
|
||||
重启Ubuntu后,打开终端直接输入"python" 然后按“Enter”键: 若出现如下图,则表示成功把Miniconda设置为Python默认环境。
|
||||
|
||||
![enter image description here](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/Conda_Python_version.png "enter image title here")
|
||||
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/Conda_Python_version.png "enter image title here")
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user