A comprehensive stock analysis and forecasting web application built with Streamlit, featuring advanced machine learning models for stock price prediction.
- 20+ Indian Stocks: Comprehensive coverage of major Indian companies
- Real-time Data: Live stock data from Yahoo Finance API
- Historical Analysis: Data from 2000 to present
- Company Information: Founder details, history, and current status
- ARIMA Forecasting: Statistical time series analysis
- LSTM Neural Networks: Deep learning for price prediction
- Accuracy Metrics: Model performance evaluation
- 30-day Forecasts: Future price predictions
- Technical Indicators: RSI, MACD, Moving Averages
- Risk Metrics: Sharpe Ratio, VaR, Max Drawdown
- Performance Metrics: Total returns, volatility analysis
- Volume Analysis: Trading volume insights
- Modern Web App: Built with Streamlit
- Responsive Design: Works on desktop and mobile
- Interactive Charts: Matplotlib visualizations
- Professional Styling: Custom CSS and themes
- Python 3.8 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/PRANAV0494/Stock_Project.git cd Stock_Project -
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run app.py
-
Open your browser Navigate to
http://localhost:8501
Stock_Project/
βββ app.py # Main Streamlit application
βββ config.py # Configuration and stock data
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ utils/ # Utility modules
βββ __init__.py
βββ data_fetcher.py # Stock data fetching
βββ metrics_calculator.py # Financial metrics calculation
βββ arima_forecaster.py # ARIMA model implementation
βββ lstm_forecaster.py # LSTM neural network
βββ ui_components.py # UI components and styling
The application includes 20 major Indian stocks:
- IT Sector: TCS, Infosys, Wipro, HCL Tech
- Banking: HDFC Bank, ICICI Bank, SBI
- Energy: Reliance, Coal India, Adani Green
- Manufacturing: Maruti, Bajaj Auto, Asian Paints
- Others: ITC, Titan, UltraTech Cement, Sun Pharma
- ARIMA: Order (5,1,0) with 30-day forecast
- LSTM: 60 time steps, 50 units, 10 epochs
- Choose from the dropdown menu in the sidebar
- View company information and history
- Select start and end dates for analysis
- Data available from 2000 to present
- Click "Fetch Data" button
- View stock metrics and performance
- Basic Metrics: Highest/lowest prices, best buy/sell times
- ARIMA Forecast: Statistical price predictions
- LSTM Predictions: AI-powered price forecasting
- Visualizations: Interactive charts and graphs
- Frontend: Streamlit
- Data Processing: Pandas, NumPy
- Machine Learning: Scikit-learn, TensorFlow/Keras
- Statistics: StatsModels
- Data Source: Yahoo Finance API
- Visualization: Matplotlib
- Modular Design: Separated concerns into utility modules
- Error Handling: Comprehensive error handling and logging
- Type Hints: Full Python type annotations
- Documentation: Detailed docstrings and comments
- Efficient Data Processing: Optimized pandas operations
- Model Caching: Prevents unnecessary retraining
- Memory Management: Efficient data handling
- Scalable Architecture: Easy to extend and modify
- Accuracy: Typically 80-90%
- Best For: Short-term trends and seasonal patterns
- Use Case: Conservative forecasting
- Accuracy: Typically 80-90%
- Best For: Complex patterns and long-term trends
- Use Case: Advanced AI-powered predictions
from utils.data_fetcher import get_stock_data
data = get_stock_data("TCS.NS", start_date, end_date)from utils.metrics_calculator import calculate_stock_metrics
metrics = calculate_stock_metrics(stock_data)from utils.arima_forecaster import ARIMAForecaster
forecaster = ARIMAForecaster()
forecast, accuracy = forecaster.forecast(data)from utils.lstm_forecaster import LSTMForecaster
forecaster = LSTMForecaster()
predictions, accuracy = forecaster.forecast(data)- Portfolio Analysis: Multi-stock comparison
- Real-time Updates: Live data streaming
- Export Functionality: PDF/Excel reports
- More Models: XGBoost, Random Forest
- Technical Indicators: Advanced charting
- Backtesting: Historical strategy testing
- Model Persistence: Save trained models
- API Rate Limiting: Better data source management
- Performance Optimization: Faster model training
- Mobile App: React Native version
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests (if applicable)
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
# Install development dependencies
pip install -r requirements.txt
# Run tests
pytest
# Code formatting
black .
# Linting
flake8This project is licensed under the MIT License - see the LICENSE file for details.
Pranav Maheshwari
- GitHub: @PRANAV0494
- LinkedIn: Pranav Maheshwari
- Email: pranavm494@gmail.com
- Yahoo Finance: For providing stock data
- Streamlit: For the amazing web framework
- Open Source Community: For the ML libraries
- College Project: Academic project for learning purposes
If you have any questions or need help:
- Check the documentation above
- Search existing issues on GitHub
- Create a new issue with detailed description
- Contact the author directly
This application is for educational and research purposes only.
- Stock predictions are not financial advice
- Always consult with financial professionals
- Past performance doesn't guarantee future results
- Use at your own risk
β Star this repository if you find it helpful!
π Keep updated with the latest features and improvements.