This project is a comprehensive analysis of Bitcoin and the S&P 500. The purpose of this project is to identify which of these two assets would be the most profitable to invest in. This is determined by analyzing the returns of holding the asset long-term, trading the asset over the same time period using a basic EMA strategy, and analyzing Monte Carlo Simulations to identify possible future movement.
This project leverages python with the following packages:
-
Pandas - For plotting and dataframes.
-
Pandas TA - For indicators.
-
PyViz - For plotting with hvplot.
-
dotenv - For accessing the .env file.
-
Voila - For web deployment.
-
Alpaca Trade API - For financial data from Alpaca
-
MCForecastTools - For Monte Carlo simulations. For documentation, use ?MCSimulation
Before first running the application install the following dependencies:
pip install pandas
pip install pandas_ta
pip install python-dotenv
pip install alpaca-trade-api
pip install voila
Login to Conda Dev
environment and install the following dependencies:
conda install -c pyviz hvplot
Jupyter may be required to view the .ipynb file.
pip install jupyter
This application also utilizes a .env file in order to store API keys and secret keys for the Alpaca API & SDK. In order to use this, you must create a .env file and set it up like the following:
ALPACA_API_KEY = "<Your API Key Here>"
ALPACA_SECRET_KEY = "<Your Secret Key Here>"
The MCForecastTools.py included contains everything needed for the Monte Carlo simulations.
To use Voila, type the following into the terminal while in the cloned project repository.
voila crypto-vs-the-market.ipynb
This will deploy the notebook as an interactive web app like the example pictured below.
Brought to you by: