mdnh commited on
Commit
eef46f2
Β·
verified Β·
1 Parent(s): 5fe5b2a

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +124 -0
README.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: cc-by-4.0
5
+ size_categories:
6
+ - 10K<n<100K
7
+ task_categories:
8
+ - time-series-forecasting
9
+ - tabular-classification
10
+ tags:
11
+ - finance
12
+ - stock-market
13
+ - technical-indicators
14
+ - time-series
15
+ - trading
16
+ - OHLCV
17
+ pretty_name: Hourly Stock Prices with Technical Indicators (2023)
18
+ ---
19
+
20
+ # Hourly Stock Prices + Technical Indicators (2023)
21
+
22
+ This dataset contains **hourly OHLCV price data** and key **technical indicators**
23
+ for 8 major U.S. tickers across different sectors. Perfect for time series forecasting,
24
+ technical analysis, and machine learning projects.
25
+
26
+ **Coverage:** January 3, 2023 – December 18, 2023
27
+ **Symbols:** AAPL, MSFT, NVDA, JPM, XOM, SPY, TSLA, AMZN
28
+ **Records:** 11,202
29
+ **Size:** 2.16 MB
30
+
31
+ ---
32
+
33
+ ## πŸ“Š Columns
34
+
35
+ | Column | Description |
36
+ |---------|-------------|
37
+ | timestamp | Date & time in UTC (YYYY-MM-DD HH:MM:SS) |
38
+ | symbol | Stock ticker |
39
+ | open, high, low, close, volume | OHLCV data |
40
+ | sma_10, sma_50 | Simple moving averages |
41
+ | ema_20 | Exponential moving average |
42
+ | rsi_14 | Relative Strength Index |
43
+ | macd, macd_signal, macd_hist | MACD components |
44
+ | volatility_20 | Rolling volatility (20-hour window) |
45
+ | target_up_next | Binary target: 1 if next hour close β‰₯ 0.05% higher |
46
+
47
+ ---
48
+
49
+ ## βš™οΈ Technical Details
50
+
51
+ - **Data source:** Publicly available financial market data (2023), aggregated and preprocessed to include technical indicators and binary movement labels.
52
+ - **Interval:** 1 hour (aggregated from minute-level data)
53
+ - **Technical indicators:** Calculated using pandas with proper groupby operations per symbol
54
+ - **Missing values:** 16 rows (0.14%) in `volatility_20` column - occurs at the start of each symbol's time series where insufficient history exists for 20-hour rolling window
55
+ - **Timestamps:** UTC format, ISO 8601 compliant (`YYYY-MM-DD HH:MM:SS`)
56
+ - **Metadata:** `metadata.json` contains full dataset generation details including date ranges, symbols, and target threshold
57
+
58
+ ## πŸ“ˆ Data Quality
59
+
60
+ - βœ… No duplicate records
61
+ - βœ… All prices positive and valid
62
+ - βœ… All volumes positive
63
+ - βœ… Timestamps properly formatted
64
+ - βœ… Target variable balanced (41.75% ups, 58.25% downs)
65
+
66
+ ---
67
+
68
+ ## πŸš€ Quick Start
69
+
70
+ ### Load from Hugging Face
71
+ ```python
72
+ from datasets import load_dataset
73
+ import pandas as pd
74
+
75
+ # Load dataset
76
+ dataset = load_dataset("YOUR_USERNAME/hourly-stock-data-2023")
77
+ df = pd.DataFrame(dataset['train'])
78
+
79
+ # Convert timestamp to datetime
80
+ df['timestamp'] = pd.to_datetime(df['timestamp'])
81
+
82
+ print(df.head())
83
+ ```
84
+
85
+ ### Direct CSV loading
86
+ ```python
87
+ import pandas as pd
88
+
89
+ df = pd.read_csv('hf://datasets/YOUR_USERNAME/hourly-stock-data-2023/hourly_stock_prices_technical_indicators.csv')
90
+ df['timestamp'] = pd.to_datetime(df['timestamp'])
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 🧠 Example Usage
96
+
97
+ ### Load and explore
98
+ ```python
99
+ import pandas as pd
100
+
101
+ # Load dataset
102
+ df = pd.read_csv('hourly_stock_prices_technical_indicators.csv')
103
+ df['timestamp'] = pd.to_datetime(df['timestamp'])
104
+
105
+ # Basic statistics
106
+ print(f"Total records: {len(df):,}")
107
+ print(f"Symbols: {df['symbol'].nunique()}")
108
+ print(f"Date range: {df['timestamp'].min()} to {df['timestamp'].max()}")
109
+
110
+ # Target distribution per symbol
111
+ df.groupby('symbol')['target_up_next'].mean()
112
+ ```
113
+
114
+ ### Time series analysis
115
+ ```python
116
+ # Filter for specific symbol
117
+ aapl = df[df['symbol'] == 'AAPL'].set_index('timestamp')
118
+
119
+ # Plot price with moving averages
120
+ import matplotlib.pyplot as plt
121
+ aapl[['close', 'sma_10', 'sma_50', 'ema_20']].plot(figsize=(12, 6))
122
+ plt.title('AAPL Price with Technical Indicators')
123
+ plt.show()
124
+ ```