This is a multi-function jupyter lab notebook (stored as sentiment_analyzer.ipynb) that compares the sentiments of Elon Musk tweets versus stock market reactions from the individual stocks referenced in his tweets. Elon Musk, the richest man on Earth with over 107M followers on twitter, uses the platform to share his opinions, often controversial. In addition, Elon was charged with securities fraud by the SEC because of misleading tweets causing price fluctuations.
In this notebook we hope to answer the following questions:
- Does a correlation exist between Elons tweets and stock market reactions ?
- Is it possible to predict whether or not a stock with rise/fall/remain with the sentiment of his tweets?
- Can we design a stock purchase method based on Elons tweets?
Bonus
- Do Elons tweets affect companies other than TSLA? (TEST: 'DOGE' + 'TWTR')
- Should we consider Elons tweet history on a certain company before investing?
Datasets is provided by:
- Kaggle
- Yahoo Finance (yfinance)
This project leverages python 3.7 with the following packages:
- pandas
- scikit-learn
- yfinance
- hvplot
- Clone this repository by opening your terminal and entering the following commands:
git clone https://github.com/smruthid/ElonTweetAnalysis.git
cd ElonTweetAnalysis
- After activating your preferred virtual env, install the required pre-requisites / libraries:
pip install -r requirements.txt
- Edit your .env file and populate the required credentials:
MEANINGCLOUD_KEY=<insert your meaningcloud API key here>
Obtain a key at [Meaningcloud](https://www.meaningcloud.com/developer/create-account)
This application runs as a Jupyter Notebook. Open your terminal, navigate to the folder you cloned from Github, and type:
jupyter lab
The source code for the application is licensed under the MIT license, which you can find in the LICENSE file in this repo.
UC Berkeley Extension Fintech Bootcamp '22