Skip to content

Corerishi/StockSight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📈 StockSight

End-to-end stock analysis pipeline — fetches live market data, computes technical indicators, and predicts closing prices using Linear Regression.

Python Jupyter scikit-learn yfinance License


🧠 What is this?

This project is a complete stock market analysis and prediction notebook built for Microsoft Corp (MSFT). It pulls a full year of real historical data directly from Yahoo Finance, computes classic technical indicators used by traders, visualizes market trends, and trains a Linear Regression model to predict future closing prices — all in one clean Jupyter Notebook.


✨ What It Does

  • 📡 Live data fetching — pulls 1 year of OHLCV data for MSFT via yfinance
  • 🧹 Data cleaning — drops irrelevant columns, handles missing values
  • 📊 Technical indicators — computes 50-day MA, 200-day MA, and RSI (14-day)
  • 📉 Trend visualization — plots closing price overlaid with moving averages
  • 🤖 Price prediction — Linear Regression model trained on timestamped close prices
  • 🎯 Actual vs Predicted — side-by-side plot of real vs model-predicted prices

🛠️ Tech Stack

Layer Technology
Data Source yfinance (Yahoo Finance API)
Data Handling Pandas
Visualization Matplotlib, Seaborn
ML Model scikit-learn (Linear Regression)
Environment Jupyter Notebook

🔬 Pipeline Overview

yfinance pulls 1 year of MSFT data
(Open, High, Low, Close, Volume)
        │
        ▼
  Data Cleaning
  (drop nulls, remove unused columns)
        │
        ▼
  Feature Engineering
  ├── 50-Day Moving Average
  ├── 200-Day Moving Average
  └── RSI — Relative Strength Index (14-day)
        │
        ▼
  Visualization
  └── Closing Price + MA overlay chart
        │
        ▼
  Linear Regression Model
  (Date timestamp → Close price)
  ├── 80/20 Train-Test Split
  └── Predict on full dataset
        │
        ▼
  Actual vs Predicted Price Plot

📊 Technical Indicators Explained

Indicator What it tells you
50-Day MA Short-term price trend direction
200-Day MA Long-term trend; crossover with 50MA signals buy/sell
RSI (14-day) Momentum oscillator — above 70 = overbought, below 30 = oversold

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • Jupyter Notebook or JupyterLab

Installation

# 1. Clone the repository
git clone https://github.com/Corerishi/Stock-Market-Analysis-Prediction.git
cd Stock-Market-Analysis-Prediction

# 2. Install dependencies
pip install yfinance pandas matplotlib seaborn scikit-learn jupyter

# 3. Launch Jupyter
jupyter notebook stock_analysis.ipynb

Note: The notebook fetches live data on every run — prices will reflect the most recent 1-year window from Yahoo Finance.


📁 Project Structure

Stock-Market-Analysis-Prediction/
├── stock_analysis.ipynb    # Main analysis + prediction notebook
├── LICENSE
└── README.md

📌 Key Takeaways

  • Demonstrates a full data science workflow: data ingestion → cleaning → feature engineering → modelling → visualization
  • RSI and Moving Average calculations are implemented from scratch using Pandas (no TA libraries)
  • Linear Regression is used as a baseline model — a solid starting point before exploring LSTM or ARIMA for time-series forecasting

👨‍💻 Author

Rishi Raj
MCA — CHRIST (Deemed to be University)
LinkedIn · GitHub


📄 License

This project is licensed under the MIT License.

About

End-to-end stock market analysis notebook — fetches live MSFT data, computes 50MA, 200MA & RSI indicators, and predicts closing prices using Linear Regression.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors