CCXT.OHLCV (ccxt_client v0.6.1)

Copy Markdown View Source

Candlestick (OHLCV) bar data.

Represents a single candlestick with open, high, low, close prices and volume for a time period.

Fields

  • timestamp - Period start time in milliseconds
  • open - Opening price
  • high - Highest price
  • low - Lowest price
  • close - Closing price
  • volume - Trading volume in base currency

Summary

Functions

Creates an OHLCV struct from a list.

JSON Schema for the OHLCV unified type.

Types

t()

@type t() :: %CCXT.OHLCV{
  close: number() | nil,
  high: number() | nil,
  low: number() | nil,
  open: number() | nil,
  timestamp: integer(),
  volume: number() | nil
}

Functions

from_list(list)

@spec from_list([number() | nil]) :: t()

Creates an OHLCV struct from a list.

CCXT exchanges return candles as [timestamp, open, high, low, close, volume].

Examples

CCXT.OHLCV.from_list([1_680_000_000_000, 28000.0, 28500.0, 27800.0, 28200.0, 150.5])

schema()

@spec schema() :: map()

JSON Schema for the OHLCV unified type.