Skip to content

candlestick()

Transform pre-aggregated candlestick data into the correct form to use with `candlestick_agg` functions

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.

The syntax is:

candlestick(
ts TIMESTAMPTZ,
open DOUBLE PRECISION,
high DOUBLE PRECISION,
low DOUBLE PRECISION,
close DOUBLE PRECISION,
volume DOUBLE PRECISION
) RETURNS Candlestick
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
ColumnTypeDescription
aggCandlestickAn 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.