A professional-grade, interactive stock price prediction web app built with LSTM (Long Short-Term Memory) neural networks and deployed via Streamlit. Built this project as my final project for the semester.
| Feature | Details |
|---|---|
| Interactive Technical Chart | Candlestick chart with MA20, MA50, MA200, Bollinger Bands, RSI, MACD |
| LSTM Model | 2-layer LSTM with Dropout, Early Stopping, and train/test split |
| Model Metrics | RMSE, MAE, MAPE, and Direction Accuracy on the test set |
| Future Forecasting | Predict up to 90 business days into the future |
| Configurable Hyperparameters | Look-back window, LSTM units, dropout, epochs, batch size |
| Company Info | Real-time KPIs: latest close, 52-week high/low, market cap, sector |
| Raw Data Table | View last 50 rows of enriched DataFrame |
| Dark Theme UI | Professional Plotly dark theme throughout |
Ticker: AAPL / MSFT / TSLA / NVDA / any Yahoo Finance symbol
Date Range: Configurable (default 2018–2025)
Forecast: Up to 90 days ahead
git clone https://github.com/<your-username>/stock-market-prediction.git
cd stock-market-predictionpython -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtstreamlit run sm.pyThe app opens automatically at http://localhost:8501.
stock-market-prediction/
│
├── sm.py # Main Streamlit application
├── requirements.txt # Python dependencies
└── README.md # This file
Input → LSTM(units, return_sequences=True)
→ Dropout
→ LSTM(units/2)
→ Dropout
→ Dense(25, relu)
→ Dense(1)
Loss: Mean Squared Error
Optimizer: Adam
Callbacks: EarlyStopping (patience=8, restore_best_weights=True)
| Indicator | Period |
|---|---|
| Simple Moving Average | MA20, MA50, MA200 |
| Bollinger Bands | 20-day, ±2σ |
| RSI | 14-day |
| MACD | EMA(12) − EMA(26) + Signal(9) |
| Parameter | Default | Range |
|---|---|---|
| Look-back Window | 60 days | 30–120 |
| LSTM Units | 100 | 32–256 |
| Dropout Rate | 0.2 | 0.0–0.5 |
| Max Epochs | 50 | 10–100 |
| Batch Size | 64 | 16–128 |
| Train Split | 80% | 60–90% |
| Future Forecast | 30 days | 0–90 |
This project is for educational purposes only. Stock market predictions are inherently uncertain and should not be used as financial advice. Always consult a licensed financial advisor before making investment decisions.
This project is licensed under the MIT License.
- yfinance — Yahoo Finance market data
- TensorFlow / Keras — Deep learning framework
- Streamlit — App framework
- Plotly — Interactive charts