Windows environment: Win7 64bit
Rqalpha version 3.0.9
Reference Document: Http://rqalpha.readthedocs.io/zh_CN/latest/intro/install.html
Prerequisites:
Because both components of the installation bcolz,ta-lib need to be installed vs2015
So let's assume that you're done with the prerequisites. VS2015 is installed, and in a custom installation ensure that the VC + + component is selected (the VC + + component is not installed by default), and then from the menu, select vs2015 x64 Native Tools command Prompt to run as Administrator
All subsequent command-line operations are based on this, not the system's default cmd command line
First, build the Python Environment (3.6) 1, download and install Conda
Conda to Anaconda3-4.2.0-windows-x86_64.exe
The installation is complete to ensure that the Conda works correctly:
Conda--version
2, build python3.6 environment
Conda Create--name python3.6 python=3.6
When you are done, go to the python3.6 environment and look at the version of Python itself
activate python3.6
python--version
Second, install the necessary Python components 1, install PIP, Setuptools, Cython, NumPy
Pip install-u pip Setuptools cython numpy
2, installation logbook, Line_profiler,pyyaml
These 3 components directly with PIP installation will fail, so the source is installed
1) Install Logbook
Download Logbook Source: https://codeload.github.com/getlogbook/logbook/zip/1.0.0
and unzip to directory C:\python_src\logbook-1.0.0
Enter its directory:
CD/D C:\python_src\logbook-1.0.0
To run the Install command:
Python setup.py Install
:
See the results as shown to indicate that the installation was successful:
2) Install Line_profiler
Download Line_profiler Source:
Https://pypi.python.org/packages/14/fc/ecf4e238bb601ff829068e5a72cd1bd67b0ee0ae379db172eb6a0779c6b6/line_ Profiler-2.1.2.tar.gz#md5=141cb6996f0e3188ca05bfddcb403e36
Extract to Directory C:\python_src\line_profiler-2.1.2
Enter its directory
CD/D C:\python_src\line_profiler-2.1.2
Run the Install command
Python setup.py Install
:
See the results as shown to indicate that the installation was successful:
3) Install Pyyaml
Download Source: http://pyyaml.org/download/pyyaml/PyYAML-3.12.tar.gz
Unzip to C:\python_src\PyYAML-3.12
Enter this directory
CD/D C:\python_src\PyYAML-3.12
Run the Install command
CD/D C:\python_src\PyYAML-3.12
As shown
3, install BCOLZ,TA-LIB1) installation Bcolz
Installing this component cannot be performed with PIP, it will fail and can only be used Easy_install
Easy_install-u Bcolz
2) Install Ta-lib
Ta-lab need to download the MSVC Library source code and successfully compiled, and then use Python corresponding source for installation
Download MSVC Library Source: Https://jaist.dl.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-msvc.zip
Unzip to C:\ta-lib(specifically, the directory here cannot be changed, otherwise there may be an error)
Go to the Compile directory
CD/D c:\ta-lib\c\make\cdr\win32\msvc
Perform the compilation
Nmake
:
Download Python library Source: https://codeload.github.com/mrjbq7/ta-lib/tar.gz/TA_Lib-0.4.10
Unzip to C:\python_src\ta-lib-TA_Lib-0.4.10\ta-lib-TA_Lib-0.4.10
Enter the source directory
CD/D C:\python_src\ta-lib-TA_Lib-0.4.10\ta-lib-TA_Lib-0.4.10
Run the Install command
Python setup.py Install
As shown in the following:
Finally, check to see if the components are all installed properly:
PIP List
Third, installation Rqalpha
To run the command:
Pip install-i https://pypi.tuna.tsinghua.edu.cn/simple rqalpha
When you are finished, run the command:
Version
As shown in the following:
Four, run RQALPHA1, download data
Rqalpha Update_bundle
2. Display MoD
MoD List
3. Operating Example
Rqalpha run-f "C:\Program files\anaconda3\envs\python3.6\lib\site-packages\rqalpha\examples/buy_and_hold.py "- s 2017-01-01-e 2017-06-30--account stock 100000--plot
As shown in the following:
Finally attach the need to download the source code, in case of a contingency, Link: https://pan.baidu.com/s/1pM2OxSn Password: fe4s
Rqalpha Environment Building (Windows edition)