Skip to main content
Since 1.14.0 Transform pre-aggregated candlestick data into a candlestick aggregate object. This object contains the data in the correct form to use with the accessors and rollups in this function group. If you’re starting with raw tick data rather than candlestick data, use candlestick_agg() instead.
candlestick(
  ts TIMESTAMPTZ,
  open DOUBLE PRECISION,
  high DOUBLE PRECISION,
  low DOUBLE PRECISION,
  close DOUBLE PRECISION,
  volume DOUBLE PRECISION
) RETURNS Candlestick

Arguments

NameTypeDefaultRequiredDescription
tsTIMESTAMPTZ-Timestamp associated with stock price
openDOUBLE PRECISION-Opening price of candlestick
highDOUBLE PRECISION-High price of candlestick
lowDOUBLE PRECISION-Low price of candlestick
closeDOUBLE PRECISION-Closing price of candlestick
volumeDOUBLE PRECISION-Total volume of trades during the candlestick period

Returns

An object storing (timestamp, value) pairs for each of the opening, high, low, and closing prices, in addition to information used to calculate the total volume and Volume Weighted Average Price.