# Stock Market Time Series Dataset - Project Structure

<!--
Author: Molla Samser
Organization: RSK World
Designer & Tester: Rima Khatun
Website: https://rskworld.in/
Email: help@rskworld.in
Phone: +91 93305 39277
Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
-->

## Complete Project Structure

```
stock-time-series/
│
├── data/                           # Stock market data files
│   ├── AAPL.csv                   # Apple Inc. stock data (252 trading days)
│   ├── GOOGL.csv                  # Alphabet Inc. stock data
│   ├── MSFT.csv                   # Microsoft Corp. stock data
│   ├── AMZN.csv                   # Amazon.com Inc. stock data
│   └── TSLA.csv                   # Tesla Inc. stock data
│
├── metadata/                       # Metadata and documentation
│   ├── stock_info.json            # Detailed stock information
│   └── indicators.json            # Technical indicators documentation
│
├── scripts/                        # Python analysis scripts
│   ├── load_data.py               # Data loading utilities
│   ├── analyze.py                 # Statistical analysis tools
│   ├── forecast.py                # Time series forecasting
│   └── visualize.py               # Visualization utilities
│
├── index.html                      # Professional demo webpage
├── README.md                       # Main documentation
├── requirements.txt                # Python dependencies
├── LICENSE                         # License information
├── CHANGELOG.md                    # Version history
├── .gitignore                      # Git ignore rules
├── PROJECT_STRUCTURE.md            # This file
└── stock-time-series.png.txt       # Image placeholder instructions
```

## File Descriptions

### Data Files (CSV Format)

Each CSV file contains **252 trading days** from 2020 with the following columns:
- **Date**: Trading date (YYYY-MM-DD)
- **Open**: Opening price
- **High**: Highest price of the day
- **Low**: Lowest price of the day
- **Close**: Closing price
- **Volume**: Trading volume
- **Adj Close**: Adjusted closing price
- **MA_20**: 20-day Moving Average
- **MA_50**: 50-day Moving Average
- **RSI**: Relative Strength Index
- **MACD**: Moving Average Convergence Divergence

### Metadata Files

**stock_info.json**: Contains detailed information about each stock including:
- Company name and description
- Sector and industry
- Exchange and country
- CEO, headquarters, employees
- Data quality metrics
- Contact information

**indicators.json**: Complete documentation of technical indicators including:
- Indicator definitions and formulas
- Interpretation guidelines
- Usage recommendations
- Calculation parameters

### Python Scripts

**load_data.py** (StockDataLoader class):
- Load single or multiple stocks
- Merge stock data
- Filter by date range
- Calculate returns
- Summary statistics
- Caching support

**analyze.py** (StockAnalyzer class):
- Comprehensive summary statistics
- Price history visualization
- Returns distribution analysis
- Technical indicator plotting
- Correlation analysis
- Risk metrics (Sharpe ratio, max drawdown)

**forecast.py** (StockForecaster class):
- Simple Moving Average forecasting
- Exponential Smoothing
- ARIMA-based forecasting
- Confidence intervals
- Forecast comparison tools
- Visualization of predictions

**visualize.py** (StockVisualizer class):
- Candlestick charts
- Multiple stock comparisons
- Correlation matrices
- Volume analysis
- Returns heatmaps
- Comprehensive dashboards

## Data Statistics

### Coverage
- **Time Period**: January 2, 2020 - December 31, 2020
- **Trading Days**: 252 days
- **Number of Stocks**: 5 (AAPL, GOOGL, MSFT, AMZN, TSLA)
- **Total Data Points**: 1,260 (252 days × 5 stocks)
- **Columns per Stock**: 11 (Date + 10 data columns)

### Stocks Included

| Symbol | Company | Sector | Industry |
|--------|---------|--------|----------|
| AAPL | Apple Inc. | Technology | Consumer Electronics |
| GOOGL | Alphabet Inc. | Technology | Internet Content |
| MSFT | Microsoft Corp. | Technology | Software Infrastructure |
| AMZN | Amazon.com Inc. | Consumer Cyclical | Internet Retail |
| TSLA | Tesla Inc. | Consumer Cyclical | Auto Manufacturers |

## Features

### Technical Indicators
1. **MA_20**: 20-day Simple Moving Average
2. **MA_50**: 50-day Simple Moving Average
3. **RSI**: Relative Strength Index (14-period)
4. **MACD**: Moving Average Convergence Divergence

### Analysis Capabilities
- ✅ Time series forecasting
- ✅ Technical analysis
- ✅ Portfolio optimization
- ✅ Risk assessment
- ✅ Correlation analysis
- ✅ Volatility analysis
- ✅ Trend identification
- ✅ Pattern recognition

### Visualization Options
- 📊 Candlestick charts
- 📈 Line charts with moving averages
- 📉 Volume analysis
- 🔥 Correlation heatmaps
- 📊 Returns distribution
- 📈 Technical indicator plots
- 🎯 Multi-stock comparisons
- 📊 Comprehensive dashboards

## Usage Examples

### Quick Start

```python
# Load a single stock
import pandas as pd
df = pd.read_csv('data/AAPL.csv', parse_dates=['Date'], index_col='Date')
print(df.head())
```

### Using Data Loader

```python
from scripts.load_data import StockDataLoader

loader = StockDataLoader()
aapl = loader.load_stock('AAPL')
stats = loader.get_summary_stats(aapl)
```

### Analysis

```python
from scripts.analyze import StockAnalyzer

analyzer = StockAnalyzer('data/AAPL.csv')
analyzer.summary_statistics()
analyzer.plot_price_history()
analyzer.plot_technical_indicators()
```

### Forecasting

```python
from scripts.forecast import StockForecaster

forecaster = StockForecaster('data/AAPL.csv')
forecast = forecaster.exponential_smoothing_forecast(days=30)
forecaster.plot_forecast(forecast)
```

### Visualization

```python
from scripts.visualize import StockVisualizer

visualizer = StockVisualizer()
visualizer.plot_candlestick('data/AAPL.csv')
visualizer.create_dashboard('data/AAPL.csv')
```

## Dependencies

```
pandas>=2.0.0
numpy>=1.24.0
matplotlib>=3.7.0
seaborn>=0.12.0
scikit-learn>=1.3.0
statsmodels>=0.14.0
prophet>=1.1.0
```

Install all dependencies:
```bash
pip install -r requirements.txt
```

## File Sizes (Approximate)

| File | Size | Records |
|------|------|---------|
| AAPL.csv | ~80 KB | 252 rows |
| GOOGL.csv | ~80 KB | 252 rows |
| MSFT.csv | ~80 KB | 252 rows |
| AMZN.csv | ~80 KB | 252 rows |
| TSLA.csv | ~80 KB | 252 rows |
| stock_info.json | ~5 KB | - |
| indicators.json | ~8 KB | - |
| **Total Dataset** | ~450 KB | 1,260 rows |

## License

Educational and Research License
- ✅ Free for educational purposes
- ✅ Free for academic research
- ✅ Free for personal learning
- ⚠️ Commercial use requires permission

## Contact Information

**Author**: Molla Samser  
**Organization**: RSK World  
**Designer & Tester**: Rima Khatun  
**Website**: [https://rskworld.in/](https://rskworld.in/)  
**Email**: help@rskworld.in  
**Phone**: +91 93305 39277  
**Address**: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147

## Version Information

**Current Version**: 1.0.0  
**Release Date**: January 1, 2024  
**Last Updated**: January 1, 2024

See [CHANGELOG.md](CHANGELOG.md) for version history and updates.

## Support

For issues, questions, or suggestions:
- 📧 Email: help@rskworld.in
- 🌐 Website: https://rskworld.in/
- 📱 Phone: +91 93305 39277

---

**© 2024 RSK World. All rights reserved.**

Visit [rskworld.in](https://rskworld.in/) for more datasets and data science resources!

