🔮 Stock Trend Prediction App is a Streamlit-powered web interface that utilizes a pre-trained LSTM model to forecast stock closing prices. It provides interactive data visualizations, moving average analysis, and future trend predictions based on historical time-series data fetched from Alpha Vantage.
🧠 The model (
keras_model.h5
) was trained using a Long Short-Term Memory (LSTM) architecture on historical stock data. The training pipeline is not included in this repository.
🎯 Built for ML learners, finance enthusiasts, and academic or personal portfolio projects.
- 📊 Interactive Visualizations: Plot raw closing prices, 100-day and 200-day moving averages
- 🧠 LSTM Predictions: Make predictions using a trained Long Short-Term Memory model
- 🔄 Data Pipeline: Download, preprocess, scale, and inverse transform data on-the-fly
- 🧮 Real-Time Analysis: View predictions and actual stock trends in real-time with visual overlays
- 💡 Educational Focus: Designed for understanding deep learning in financial applications
Component | Library / Tool | |
---|---|---|
Web Interface | Streamlit | |
Deep Learning Model | TensorFlow / Keras | |
Financial Data | Alpha Vantage API | |
Visualization | matplotlib | |
Data Processing | pandas, NumPy | |
Scaling | scikit-learn |
stock-trend-prediction/
├── keras_model.h5 # Trained LSTM model
├── app.py # Streamlit application
├── README.md # Project overview
├── requirements.txt # Python dependencies
├── output_graphs/ # Prediction and training result visualizations
│ ├── 100 and 200.png
│ ├── 100.png
│ └── Predicted.png
To explore and experiment with stock trend forecasting using deep learning, clone this repo and follow the steps below.
Make sure you have Python 3.10+ installed.
-
Install the required packages
pip install -r requirements.txt
-
Place the trained model
Ensure
keras_model.h5
(trained LSTM model) is present in the root directory. -
Run the application
streamlit run app.py
-
Interact
Open your browser and go to
http://localhost:8501
to interact with the app.
The predictions made by this application are the result of a deep learning model trained on historical data and should not be used to make actual investment or trading decisions.
- This project does not provide financial advice.
- The developer and contributors are not licensed financial advisors.
- No liability or responsibility will be accepted for any financial loss or damage incurred due to reliance on the outputs of this app.
-
Model performance is limited by:
- Quantity and quality of historical data
- Latency or inaccuracies from third-party APIs (e.g., Alpha Vantage)
- Lack of awareness of company fundamentals, breaking news, or macroeconomic indicators
- Overfitting or underfitting during training
-
It does not account for:
- Intraday volatility
- Real-time data streams
- Sudden market shifts or geopolitical risks
-
⚙️ Alpha Vantage API Limitations:
- Free tier usage is subject to rate limits (typically 5 requests per minute and 500 per day).
- Repeated rapid queries may lead to temporary blocking of data access.
This project is intended to showcase:
- Time series forecasting using LSTMs
- Deployment using Streamlit
- Real-world integration with APIs and visualizations
It is NOT designed for live trading, algorithmic execution, or portfolio management. Any usage beyond educational or research purposes is strongly discouraged.
If deployed publicly, this app:
- Does not collect or store personal user data
- Processes ticker inputs locally
- Relies on publicly accessible data via the Alpha Vantage API
Always validate external API input sources and sanitize ticker symbols in production.
Contributions are welcome! Please open an issue to discuss changes or improvements before submitting a pull request.
If you'd like to add features, improve model performance, or extend visualizations — feel free to fork and build upon it.
Developed by @Avnish1447
✨ Happy Learning & Responsible Forecasting 📉📈