Welcome to the Stock Trading Analysis of Politicians project! This repository showcases a Python-based analysis of stock trading data among politicians, with a focus on investigating whether politicians engage in suspicious timing of trades around legislative events. The project utilizes web scraping techniques, data parsing, and visualization to gain insights into this phenomenon.
The project was born out of a curiosity to explore the intersection of politics and finance. By analyzing stock trading data of politicians, we aim to shed light on whether there are patterns suggestive of insider trading or opportunistic trading around legislative events. This investigation is crucial for ensuring transparency and accountability in financial markets and political practices.
- Web Scraping: Utilizes the Beautiful Soup framework to scrape stock trading data from Quiver Quant.
- Data Parsing: Parses the scraped data and compiles it into CSV files for further analysis.
- Data Visualization: Utilizes Plotly to visualize the trading data, allowing for interactive exploration of trends and patterns.
- Hypothesis Testing: Investigates the hypothesis that politicians time their trades around legislative events by analyzing spikes or patterns in trading activity.
- Clone this repository to your local machine.
- Navigate to the project directory.
- Run the Python script to parse the trading data and generate CSV files.
- Open the Jupyter notebook
stock_trading_analysis.ipynb
to visualize the data using Plotly.
- Python 3.x
- Requests
- Beautiful Soup
- Plotly
- Pandas
- Blue: Represents buy transactions.
- Red: Represents sell transactions.
- Integration of machine learning algorithms for predictive analysis.
- Expansion of data sources and incorporation of additional datasets for comprehensive analysis.
- Deployment of interactive dashboards for real-time monitoring of trading activities.
Contributions to this project are welcome! Whether it's through code contributions, bug fixes, or feature enhancements, we appreciate any contributions that help advance our understanding of stock trading among politicians.
This project is licensed under the MIT License.
Created by Cody Johnson.
Connect with me on LinkedIn.