The purpose of the project is to create a process that gathers on a daily basis volatility futures data and produces historical time series that can be used as raw data to train the volatility strategy models.
requirements.txt contains the libraries used in the venv.
These instructions assume you've already installed a version of Python 3.
-
Run pip3 to install vitualenv:
pip3 install virtualenv
-
You'll need the full path to the Python 3 version of virtualenv, so run the following to view it:
which virtualenv
/home/username/opt/python-3.6.2/bin/virtualenv
-
Make a note of the full file path to the custom version of Python you just installed:
which python3
/home/username/opt/python-3.6.2/bin/python
-
Navigate to your selected directory, where you'll create the new virtual environment:
cd ~/example.com
-
Create the virtual environment while you specify the version of Python you wish to use. The following command creates a virtualenv named 'my_project' and uses the -p flag to specify the full path to the Python3 version you just installed:
virtualenv -p /home/example_username/opt/python-3.6.2/bin/python3 my_project
Running virtualenv with interpreter /home/example_username/opt/python-3.6.2/bin/python3 Using base prefix '/home/example_username/opt/python-3.6.2' New python executable in /home/example_username/example.com/env/bin/python3 Also creating executable in /home/example_username/example.com/env/bin/python Installing setuptools, pip, wheel...done.
-
To activate the new virtual environment, run the following:
source my_project/bin/activate
The name of the current virtual environment appears to the left of the prompt. For example:
(my_project) [server]$
-
To verify the correct Python version, run the following:
python -V
Python 3.6.2
-
Install the required libraries
pip install pandas
pip install pandas-market-calendars
pip install QuantLib-Python
pip install matplotlib
-
When finished working in the virtual environment, you can deactivate it by running the following:
deactivate
Virtual environment instructions source:
Code runs in the following order:
-
top_script.py
-
vix_futures_exp_dates.py
-
download_link.py
-
compare_files.py
-
time_series.py
or
-
weigted_time_series.py