A real-time stock price monitoring and prediction pipeline built with Python, designed for high-frequency trading and dynamic financial analysis using machine learning techniques and sentiment-driven insights.
-
📊 Real-time Stock Data Collection using the Yahoo Finance API (
yfinance
) -
🧹 Data Preprocessing with datetime formatting, missing-value handling, normalization
-
🧠 Ready for ML Model Integration (LSTM, XGBoost, Linear Regression)
-
🧱 Modular Design for ease of testing, scaling, and extension
-
💾 Data Saving as clean CSVs for downstream analytics
-
📉 Exploratory Analysis: Trend visualization, volatility, technical indicators
-
📦 Two working notebooks:
5stocks.ipynb
– fetches and processes multiple stock datamarketstocks.ipynb
– customizable real-time stock data pipeline
.
├── 5stocks.ipynb
├── marketstocks.ipynb
├── GenAI_Report_Group_9.pdf # Detailed project report
├── requirements.txt
└── README.md
Function | Description |
---|---|
get_live_stock_data() |
Fetches OHLCV data from Yahoo Finance |
preprocess_data() |
Cleans data: datetime conversion, missing value treatment, etc. |
save_data() |
Saves cleaned data to CSV |
run_pipeline() |
Orchestrates full flow: fetch → preprocess → save |
- 📍 Trend & volatility plots (OHLC, rolling std deviation)
- 🔁 Technical indicators like RSI, MACD, Moving Averages
- 📌 Correlation heatmaps
- 📦 Histogram and distribution plots for returns
- 🤖 Integrate ML models like LSTM or XGBoost for forecasting
- 📊 Build interactive dashboards with Streamlit or Dash
- 🔔 Real-time alerts for trade signals or major price shifts
- 💬 Integrate news sentiment analysis for smarter predictions
git clone https://github.com/Anshul-ydv/Algo_trader_with_sentiment.git
cd Algotrading-Sentiment
pip install -r requirements.txt
In marketstocks.ipynb
, change:
ticker = 'TCS.NS'
interval = '1d'
Run the pipeline:
run_pipeline(ticker, interval, save_path='TCS_cleaned.csv')
To analyze multiple stocks, use 5stocks.ipynb
.
For complete methodology, literature review, and diagrams, see [Report.pdf).
This project is licensed under the MIT License.