Our project focuses on predicting daily stock movements for leading electric-vehicle (EV) companies. This is a binary classification task, where the objective is to determine whether the next day's closing price of major EV stocks, namely Tesla (TSLA), NIO (NIO), Rivian (RIVN), General Motors (GM), and BYD (BYDDF), will increase (1) or decrease (0) compared to the current day.
This application serves as a dashboard blending technical analysis with machine learning insights. It aggregates real-time stock data and macroeconomic indicators to train a logistic regression model for directional price forecasting.
Key features include:
- Interactive dashboard built with Streamlit.
- Real-time data fetching using Yahoo Finance and FRED API.
- Technical indicators calculation (RSI, MACD, Bollinger Bands).
- Outlier detection using Robust Z-Score.
- Binary classification model for next-day price direction.
- Stock Data: Yahoo Finance (TSLA, NIO, RIVN, GM, BYDDF)
- Macroeconomic Data: Federal Reserve Economic Data (FRED)
- Federal Funds Rate (FEDFUNDS)
- Consumer Price Index (CPIAUCSL)
- Unemployment Rate (UNRATE)
- Clone the repository.
- Install the required Python packages:
pip install streamlit plotly yfinance fredapi scikit-learn pandas numpyThe application requires a FRED API Key to fetch macroeconomic data.
- Obtain an API Key from FRED.
- Create a secrets file at
.streamlit/secrets.toml:
FRED_API_KEY = "your_api_key_here"Alternatively, you can set FRED_API_KEY as an environment variable.
Run the application from the terminal:
python -m streamlit run app.pyThe dashboard will open in your default web browser at http://localhost:8501.
app.py: Main application entry point handling UI and visualization.utils.py: Backend utilities for data fetching, processing, and machine learning.project.py: Original research script (legacy).