Skip to content

Analysis of Bitcoin and the S&P 500 to identify best investment opportunity. Analysis includes long-term holding, shorter-term trading, and Monte Carlo simulations to find the most profitable opportunities and potential future investments.

License

Notifications You must be signed in to change notification settings

MajidKouki/crypto-vs-the-market

Repository files navigation

Crypto vs the Market

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.


Technologies

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


Installation Guide

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.


Usage

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.

Voila Web App


Contributors

Brought to you by:


License

License: MIT

About

Analysis of Bitcoin and the S&P 500 to identify best investment opportunity. Analysis includes long-term holding, shorter-term trading, and Monte Carlo simulations to find the most profitable opportunities and potential future investments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •