Asset.py
: file contains the 'Asset' class, which keeps track of an individual's finance throughout trading.get_data.py
: file contains the 'get_data' function, which is used to get the bitcoin ohlcv data in 720 days.env.yml
: file contains the conda environment information.EMA_SMA (baseline).ipynb
file contains the baseline strategy, andRSI (genetic algorithm).ipynb
file contains our proposed strategy.- The generated figures will be written into the
figure
folder.
- Clone this repository to your computer by
git clone <repository url>
- Switch to the main branch by
git checkout main
- Open the folder in VS Code or jupyter notebook
- If you have installed the
ta
andcxtt
packages, you can skip the step 5 and 6. Otherwise, please follow the step 5 and 6 to create a new conda environment. - Create a new conda environment and activate it in your local machine by
conda env create -f env.yml
andconda activate btcbot
- Setting the VS Code to use the conda environment you just created (Ctrl + Shift + P > Python: Select Interpreter > btcbot)
- Run the code in the
EMA_SMA (baseline).ipynb
andRSI (genetic algorithm).ipynb
files to reproduce the results. (You can run the code by clicking theRun Cell
button in the top right corner of each cell, or useShift + Enter
to run the code in each cell)
- If you want to install some new packages, please remember to manually add them to the env.yml without any version and os dependencies. Please DON'T export it by
conda env export --no-builds > env.yml
because it will causes some ResolvePackageNotFound Error. For example, if you run the commandpip install ipykernel
then you can add a line at the bottom of the env.yml like- ipykernel
. - If you want to deactive the conda environment, please use
conda deactivate
- If you want to delete your local conda environment, please use
conda env remove -n btcbot
- If you want to push your code, please use
git push origin <branch-name>
after usinggit add .
andgit commit -m "<your commit message>"
(You need to set theorigin
url first) - If you want to pull the latest code, please use
git pull origin <branch-name>
(You need to set theorigin
url first) - If you want to create a new branch, please use
git checkout -b <branch-name>
(We use the develop branch as the default development branch, and when we finish a version, we will merge the develop branch to the main branch). Then you can push it to the github bygit push origin <branch-name>
.