CoolFace
Datasetpublic

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.

sourceHugging Facecc-by-4.0updated 11mo agoView on Hugging Face
1likes194downloads
Dataset Card

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

ColumnDescription
timestampDate & time in UTC (YYYY-MM-DD HH:MM:SS)
symbolStock ticker
open, high, low, close, volumeOHLCV data
sma10, sma50Simple moving averages
ema_20Exponential moving average
rsi_14Relative Strength Index
macd, macdsignal, macdhistMACD components
volatility_20Rolling volatility (20-hour window)
targetupnextBinary target: 1 if next hour close โ‰ฅ 0.05% higher

โš™๏ธ 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_20 column - 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.json contains 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

python
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

python
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

python
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

python
# 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()