An AI-powered real-time stock analysis system built using:
- 🧠 Machine Learning (LightGBM)
- 📊 Interactive Dashboard (Streamlit + Plotly)
- 💹 Live market data feed (Yahoo Finance API)
- 🗂 PostgreSQL / Local mode fallback
- 🔁 Automated prediction pipeline
This project predicts BUY / SELL signals with confidence scores and displays:
✔ Candlestick charts
✔ Volume trends
✔ Technical indicators (RSI, MACD, SMA, EMA)
✔ Feature importance
✔ Auto-generated human insights
| Feature | Status |
|---|---|
| Real-time market data fetch | ✅ |
| Model prediction (Buy/Sell + confidence) | ✅ |
| ML Models stored for each stock | ✅ |
| Interactive charts (candles, volume, RSI, MACD) | ✅ |
| Technical analysis insights | ✅ |
| Refresh + live update | ✅ |
| Deployable to Streamlit Cloud | ✅ |
stock-rt-powerbi-ml/
│
├─ dashboard/
│ └─ app.py # Streamlit UI
│
├─ src/
│ ├─ predict_realtime.py # Load model + run live predictions
│ ├─ fetch_live.py # Fetch latest price from Yahoo Finance
│ ├─ insights.py # Technical indicators + insights generator
│ ├─ train_model.py # Model training script (LightGBM)
│ └─ download_historical.py # Historical data downloader
│
├─ models/ # Saved ML models (AAPL.pkl, MSFT.pkl…)
├─ data/ # Optional seed data
├─ requirements.txt
└─ README.mdDeployment Link : https://stock-price-analysis-and-prediction-qsnxiuus2ysweyidepeb9c.streamlit.app/
⚙️ Installation
1️⃣ Clone Repo
git clone https://github.com/<your-username>/stock-rt-powerbi-ml.git
cd stock-rt-powerbi-ml
2️⃣ Create Virtual Environment
python -m venv venv
Activate:
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate
3️⃣ Install Dependencies
pip install -r requirements.txt
- Data fetching Live stock data retrieved via Yahoo Finance
- Feature engineering Volume, OHLC features, technical indicators
- Model inference LightGBM model predicts BUY/SELL
- Confidence scores predict_proba() returns decision confidence
- Visualization Plotly + Streamlit render interactive analysis charts
- Insights engine Auto-text reasoning based on RSI/MACD/Crossovers
Candlestick RSI + MACD
📩 Telegram or Email trading alerts
🧩 Portfolio optimization / backtesting
🧠 Reinforcement learning model
⏱ Auto-refresh interval (5s / 15s / 30s toggle)
🌍 Multi-market (Crypto, Forex, Indian NSE/BSE)
Layer Tools Programming Python Dashboard Streamlit + Plotly AI/ML Scikit-learn, LightGBM Data Source Yahoo Finance (yfinance) Optional DB PostgreSQL
PRs are welcome. For major changes, please open an issue.
If this project helped you — star the repo ⭐ and share it!
👤 Ayush 💻 AI/ML Developer 🚀 Gen-Z Engineer who automates financial decision making.