What Is OHLCV Data and How to Use It for Trading

What Is OHLCV Data and How to Use It for Trading

OHLCV is the universal format of financial market data. Every charting platform, every backtesting framework, every trading API speaks it. Understanding exactly what it represents — and what it hides — is foundational for anyone building algo trading systems.

How a Candle Is Constructed

A candle aggregates all trades in a fixed time window:

  • Open: price of the first trade
  • High: maximum price across all trades
  • Low: minimum price across all trades
  • Close: price of the last trade
  • Volume: sum of quantities

Aggregating OHLCV from Tick Data in Python

import polars as pl

ticks = pl.read_parquet("ETH_trades.parquet").with_columns(
    pl.from_epoch("time", time_unit="ms").alias("dt")
)

ohlcv_1h = (
    ticks.group_by_dynamic("dt", every="1h")
    .agg([
        pl.col("price").first().alias("open"),
        pl.col("price").max().alias("high"),
        pl.col("price").min().alias("low"),
        pl.col("price").last().alias("close"),
        pl.col("qty").sum().alias("volume"),
    ])
    .sort("dt")
)
print(ohlcv_1h.head())

Common Mistakes

  • Treating close as execution price: use the open of the next candle instead
  • Ignoring gaps: missing candles must be documented, not assumed continuous
  • Mixing timeframes incorrectly: always aggregate from the same tick source
ETH OHLCV Pack — 6 timeframes, Last Year (rolling 12 months), audited. Free 1-week sample — direct download. → Browse the catalog

Summary

OHLCV data is a compressed representation of market activity. That compression is useful — but it destroys information. Knowing what was lost, and when that matters, separates a robust backtesting setup from one that produces results you cannot trust in production.