mdnh/hourly-stock-data-2023
Hourly Stock Prices + Technical Indicators (2023) This dataset contains hourly OHLCV price data and key technical indicators for 8 major U.S. tickers across different sectors. Perfect for time series forecasting, technical analysis, and machine learning projects. Coverage: January 3, 2023 โ December 18, 2023Symbols: AAPL, MSFT, NVDA, JPM, XOM, SPY, TSLA, AMZNRecords: 11,202Size: 2.16 MB ๐ Columns Column Description timestamp Date & time in UTCโฆ See the full description on the dataset page: https://huggingface.co/datasets/mdnh/hourly-stock-data-2023.
Hourly Stock Prices + Technical Indicators (2023)
This dataset contains hourly OHLCV price data and key technical indicators for 8 major U.S. tickers across different sectors. Perfect for time series forecasting, technical analysis, and machine learning projects.
Coverage: January 3, 2023 โ December 18, 2023 Symbols: AAPL, MSFT, NVDA, JPM, XOM, SPY, TSLA, AMZN Records: 11,202 Size: 2.16 MB
๐ Columns
โ๏ธ Technical Details
- Data source: Publicly available financial market data (2023), aggregated and preprocessed to include technical indicators and binary movement labels.
- Interval: 1 hour (aggregated from minute-level data)
- Technical indicators: Calculated using pandas with proper groupby operations per symbol
- Missing values: 16 rows (0.14%) in
volatility_20column - occurs at the start of each symbol's time series where insufficient history exists for 20-hour rolling window - Timestamps: UTC format, ISO 8601 compliant (
YYYY-MM-DD HH:MM:SS) - Metadata:
metadata.jsoncontains full dataset generation details including date ranges, symbols, and target threshold
๐ Data Quality
- โ No duplicate records
- โ All prices positive and valid
- โ All volumes positive
- โ Timestamps properly formatted
- โ Target variable balanced (41.75% ups, 58.25% downs)
๐ Quick Start
Load from Hugging Face
from datasets import load_dataset
import pandas as pd
# Load dataset
dataset = load_dataset("YOUR_USERNAME/hourly-stock-data-2023")
df = pd.DataFrame(dataset['train'])
# Convert timestamp to datetime
df['timestamp'] = pd.to_datetime(df['timestamp'])
print(df.head())Direct CSV loading
import pandas as pd
df = pd.read_csv('hf://datasets/YOUR_USERNAME/hourly-stock-data-2023/hourly_stock_prices_technical_indicators.csv')
df['timestamp'] = pd.to_datetime(df['timestamp'])๐ง Example Usage
Load and explore
import pandas as pd
# Load dataset
df = pd.read_csv('hourly_stock_prices_technical_indicators.csv')
df['timestamp'] = pd.to_datetime(df['timestamp'])
# Basic statistics
print(f"Total records: {len(df):,}")
print(f"Symbols: {df['symbol'].nunique()}")
print(f"Date range: {df['timestamp'].min()} to {df['timestamp'].max()}")
# Target distribution per symbol
df.groupby('symbol')['target_up_next'].mean()Time series analysis
# Filter for specific symbol
aapl = df[df['symbol'] == 'AAPL'].set_index('timestamp')
# Plot price with moving averages
import matplotlib.pyplot as plt
aapl[['close', 'sma_10', 'sma_50', 'ema_20']].plot(figsize=(12, 6))
plt.title('AAPL Price with Technical Indicators')
plt.show()