Principle:HKUDS AI Trader OHLCV Price Data Schema
| Knowledge Sources | |
|---|---|
| Domains | Financial_Data, Data_Schema, Market_Data |
| Last Updated | 2026-02-09 14:00 GMT |
Overview
Standard schema for representing Open-High-Low-Close-Volume (OHLCV) market data as JSON files in the Alpha Vantage format, used consistently across all asset classes in the repository.
Description
OHLCV is the canonical representation of financial time series data, capturing the five key price/volume dimensions at each time interval. This repository standardizes on the Alpha Vantage JSON schema across three asset classes (US stocks, Chinese A-shares, cryptocurrencies) with minor variations in metadata and time granularity. The schema consists of a Meta Data header containing symbol identification, last refresh timestamp, and time zone, followed by a Time Series object keyed by date/timestamp strings containing string-encoded numeric OHLCV values. This uniform structure enables the data pipeline tools and local price lookup functions to work polymorphically across markets.
Usage
Use this schema when adding new asset classes or market data sources to the AI Trader pipeline. Any data fetcher should produce files conforming to this structure to be compatible with the existing merge, lookup, and analysis tools.
Theoretical Basis
The OHLCV schema captures the essential price dynamics of a traded asset:
- Open: First traded price in the period
- High: Maximum traded price in the period
- Low: Minimum traded price in the period
- Close: Last traded price in the period (most commonly used for returns)
- Volume: Total units traded in the period
Schema invariants:
# Abstract schema description (NOT real implementation)
assert low <= open <= high
assert low <= close <= high
assert volume >= 0
# All values stored as string-encoded decimals
# Dates are ISO 8601 formatted strings
The three concrete schemas differ only in:
| Aspect | US Stocks | A-Shares | Crypto |
|---|---|---|---|
| Time key | "Time Series (60min)" | "Time Series (Daily)" | "Time Series (Daily)" |
| Granularity | 60-minute bars | Daily bars | Daily bars |
| Time zone | US/Eastern | US/Eastern | UTC |
| Volume precision | Integer | Integer | Decimal (fractional units) |