There were few Japanese articles on backtrader, so I decided to write it myself. I will write down what I stumbled upon and what I found by moving it. If you find something wrong, please let us know in the comments.
I hope that the backtrader population will increase and more commentary articles will be added.
My operating environment
Windows8.1pro 64bit
Anaconda3 2019.10
(Building a virtual environment for backtrader with Python 3.5)
There are many easy-to-understand and detailed articles on installing Anaconda3 and building a virtual environment, so please refer to them. In my case, when I installed Jupyter notebook in a virtual environment, I got a kernel error at boot time. It was written that Win32api could not be found, and it was solved by installing pywin32 via PIP in the virtual environment.
It is described in detail in this article.
The bactrader page of PypI says that it supports up to Python 3.7, but since there was a description that it was developed with Python 3.5, I created a virtual environment with 3.5 just in case. I will install bactrader here.
Launch a virtual environment from Anaconda prompt. I named the environment envbactrader. If you add this [plotting] during installation, matplotlib will be installed as well.
install.py
(envbacktrader) C:\Users\xxxx pip install backtrader[plotting]
Just in case, check the package with the conda list command.
condalist.py
(envbacktrader) C:\Users\xxxx conda list
# packages in environment at C:\Users\xxxx\Anaconda3\envs\envbacktrader:
#
# Name Version Build Channel
backtrader 1.9.74.123 pypi_0 pypi
blas 1.0 mkl
bleach 3.1.0 py_0
ca-certificates 2019.11.27 0
certifi 2018.8.24 py35_1
colorama 0.4.3 py_0
cycler 0.10.0 pypi_0 pypi
decorator 4.4.1 py_0
defusedxml 0.6.0 py_0
entrypoints 0.2.3 py35_2
icc_rt 2019.0.0 h0cc432a_1
#......abridgement
It was installed successfully.
Recommended Posts