|
| 1 | +# 📈 Stocks Trend Analyzer (Data Structures Project) |
| 2 | + |
| 3 | +**Course:** Data Structures & Algorithms (DSA) |
| 4 | +**Semester:** 3rd |
| 5 | +**Submitted To:** Sir Hasnain Yousaf Khan |
| 6 | +**Submitted By:** |
| 7 | + |
| 8 | +- 🧠 *Shazada M. Umar* (2k24_BSAI_42) |
| 9 | +- 🧠 *Moavia Amir* (2k24_BSAI_72) — contactmuawia@gmail.com |
| 10 | +- ⚙️ *Faizan Ishfaq* (2k24_BSAI_50) |
| 11 | +- ⚙️ *M. Hamza* (2k24_BSAI_46) |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## 📘 Project Overview |
| 16 | + |
| 17 | +**Stocks Trend Analyzer** is a Python-based application that analyzes historical stock market data using **Data Structures and Algorithms**. |
| 18 | +The system detects rising/falling patterns, computes moving averages, highlights buy–sell intervals, and visualizes trends using **Tkinter** and **Matplotlib**. |
| 19 | + |
| 20 | +The goal is to help students understand how DSA concepts apply to real-world financial time-series data. |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## 🔍 Problem Statement |
| 25 | + |
| 26 | +Financial datasets are large, noisy, and difficult for beginners to interpret. Without proper analysis, it becomes challenging to identify: |
| 27 | + |
| 28 | +- Continuous rising or falling trends |
| 29 | +- Local highs and lows |
| 30 | +- Smoothed patterns (moving averages) |
| 31 | +- Optimal moments to buy or sell |
| 32 | + |
| 33 | +This project provides a simple and visual solution using efficient algorithms and Python-based tools. |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## 🎯 Objectives |
| 38 | + |
| 39 | +- Build a working desktop tool to analyze stock time-series data |
| 40 | +- Implement DSA concepts such as arrays, queues, stacks, and maps |
| 41 | +- Detect trends and compute moving averages |
| 42 | +- Identify the best buy–sell intervals using an O(n) algorithm |
| 43 | +- Visualize insights using charts |
| 44 | +- Create a user-friendly GUI for easy interaction |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## 🧠 System Overview |
| 49 | + |
| 50 | +| Component | Purpose | |
| 51 | +|----------|----------| |
| 52 | +| **Python (Core)** | Implements algorithms and data structures | |
| 53 | +| **Tkinter** | GUI for importing and analyzing data | |
| 54 | +| **Matplotlib** | Visualization of trends and signals | |
| 55 | +| **CSV Dataset** | Yahoo Finance or Kaggle stock data | |
| 56 | +| **DSA Used** | Arrays, Lists, Stacks, Queues, Maps | |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## 🔬 Working Principle |
| 61 | + |
| 62 | +1. User loads a CSV file containing daily stock prices. |
| 63 | +2. Data is stored in custom **Array/List** structures. |
| 64 | +3. Algorithms run on the dataset: |
| 65 | + - Trend detection |
| 66 | + - Moving average calculation (Queue / Sliding Window) |
| 67 | + - Local high/low using Stack logic |
| 68 | + - Max-profit interval (Buy–Sell Strategy) |
| 69 | +4. Tkinter displays results and summary. |
| 70 | +5. Matplotlib generates charts with lines, markers, and trends. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## 🛠 Features |
| 75 | + |
| 76 | +- 📊 **Trend Detection:** Identifies rising/falling streaks |
| 77 | +- 📉 **Moving Averages:** Smooths noisy data using queue-based windows |
| 78 | +- 💹 **Best Buy–Sell Interval:** Shows most profitable days |
| 79 | +- 📈 **Visual Charts:** Price lines, moving averages, highs/lows |
| 80 | +- 🖥 **User-Friendly GUI:** Import CSV and analyze instantly |
| 81 | +- 🧠 **DSA-Focused Implementation:** Each module uses required structures |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## 🛠 Technologies & Tools |
| 86 | + |
| 87 | +- Python |
| 88 | +- Tkinter (GUI) |
| 89 | +- Matplotlib (Visualization) |
| 90 | +- Custom Data Structures |
| 91 | +- CSV Data (Stock Prices) |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## 📂 Folder Structure |
| 96 | + |
| 97 | +``` |
| 98 | +Stocks-Trend-Analyzer/ |
| 99 | +├─ README.md # (this file) |
| 100 | +├─ main.py # Tkinter GUI |
| 101 | +├─ algorithms/ |
| 102 | +│ ├─ trend_analysis.py |
| 103 | +│ ├─ moving_average.py |
| 104 | +│ ├─ max_profit.py |
| 105 | +│ └─ local_high_low.py |
| 106 | +├─ dsa/ |
| 107 | +│ ├─ array_list.py |
| 108 | +│ ├─ queue.py |
| 109 | +│ └─ stack.py |
| 110 | +├─ data/ |
| 111 | +│ └─ sample_stock.csv |
| 112 | +├─ charts/ |
| 113 | +│ └─ generated_charts.png |
| 114 | +└─ docs/ |
| 115 | + ├─ Proposal.pdf |
| 116 | + └─ Report.pdf |
| 117 | +``` |
| 118 | +--- |
| 119 | + |
| 120 | +## 📅 Project Timeline (6 Weeks) |
| 121 | + |
| 122 | +| Week | Task | |
| 123 | +|------|------| |
| 124 | +| Week 1 | Requirement analysis, dataset collection | |
| 125 | +| Week 2 | Implement data structures | |
| 126 | +| Week 3 | Implement algorithms | |
| 127 | +| Week 4 | Develop Tkinter GUI | |
| 128 | +| Week 5 | Add Matplotlib charts | |
| 129 | +| Week 6 | Testing, debugging, documentation | |
| 130 | + |
| 131 | +``` |
| 132 | +
|
| 133 | +--- |
| 134 | +
|
| 135 | +## 🎓 Expected Learning Outcomes |
| 136 | +
|
| 137 | +- Understand and apply DSA to financial datasets |
| 138 | +- Learn how queues, stacks, and arrays operate in practical use-cases |
| 139 | +- Gain experience with GUI development |
| 140 | +- Learn data visualization techniques |
| 141 | +- Strengthen algorithmic thinking and problem-solving |
| 142 | +
|
| 143 | +--- |
| 144 | +
|
| 145 | +## 🧾 Conclusion |
| 146 | +
|
| 147 | +The **Stocks Trend Analyzer** blends algorithms, data structures, and visualization to provide meaningful insights into stock behavior. |
| 148 | +This project demonstrates the power of DSA in solving real-world problems and sets a foundation for advanced financial analytics, predictive modeling, and multi-stock comparison systems. |
| 149 | +
|
| 150 | +--- |
| 151 | +
|
| 152 | +## 📫 Contact |
| 153 | +
|
| 154 | +- **Moavia Amir** — contactmuawia@gmail.com |
0 commit comments