Skip to content

Zimal-Fatemah/STOCK-MARKET-PREDICTION

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📈 Stock Market Prediction — LSTM

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.

Python TensorFlow Streamlit License


Demo

image image

Features

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

Demo

Ticker:     AAPL / MSFT / TSLA / NVDA / any Yahoo Finance symbol
Date Range: Configurable (default 2018–2025)
Forecast:   Up to 90 days ahead

Installation

1. Clone the repository

git clone https://github.com/<your-username>/stock-market-prediction.git
cd stock-market-prediction

2. Create a virtual environment (recommended)

python -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Run the app

streamlit run sm.py

The app opens automatically at http://localhost:8501.


📁 Project Structure

stock-market-prediction/
│
├── sm.py               # Main Streamlit application
├── requirements.txt    # Python dependencies
└── README.md           # This file

Model Architecture

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)

Technical Indicators

Indicator Period
Simple Moving Average MA20, MA50, MA200
Bollinger Bands 20-day, ±2σ
RSI 14-day
MACD EMA(12) − EMA(26) + Signal(9)

Hyperparameters (Sidebar)

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

Disclaimer

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.


📄 License

This project is licensed under the MIT License.


Acknowledgements

About

LSTM-powered stock price prediction web app with technical indicators, future forecasting & configurable hyperparameters. Built with TensorFlow & Streamlit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages