Use the RSI signal to drive algorithm buying and selling decisions. When the RSI is over 70, a stock is considered overbought and is sold. On the other hand, when the RSI is below 30, a stock is considered oversold and is bought. Here is additional information from Investorpedia.
Download and install Anaconda
Create a new environment in your conda navidagor or terminal and use Python version 3.5 given dependencies.
$ conda create -n env_zipline python=3.5
Activate the new environment.
$ conda activate env_zipline
Install the Zipline backtesting library from Quantopian.
$ conda install -c Quantopian zipline
Install interactive Python shell and a Jupyter kernel to work with Python code in Jupyter notebooks and other interactive frontends.
$ conda install -c anaconda ipykernel
Install the Python wrapper for TA-Lib
$ pip install TA-Lib
Install Pyfolio, see documentation here for more information.
pip install pyfolio
Obtain a free API key from Quandl
Set an environmental variable in your terminal with your API key.
$ export QUANDL_API_KEY='your API key here'
Ingest the Quandl Wiki Prices data into Zipline
$ zipline ingest -b quandl
Run the below code in your terminal, check the Zipline Documentation for additional information.
$ zipline run -f backtest.py --start 2014-1-1 --end 2018-1-1 -o perf.pickle --no-benchmark --capital-base 20000 --bundle quandl