---
title: candlestick() | Tiger Data Docs
description: Transform pre-aggregated candlestick data into the correct form to use with `candlestick_agg` functions
---

Since [1.14.0](https://github.com/timescale/timescaledb-toolkit/releases/tag/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()`](/docs/reference/toolkit/candlestick_agg/candlestick_agg/index.md) instead.

## Arguments

The syntax is:

```
candlestick(
  ts TIMESTAMPTZ,
  open DOUBLE PRECISION,
  high DOUBLE PRECISION,
  low DOUBLE PRECISION,
  close DOUBLE PRECISION,
  volume DOUBLE PRECISION
) RETURNS Candlestick
```

| Name   | Type             | Default | Required | Description                                          |
| ------ | ---------------- | ------- | -------- | ---------------------------------------------------- |
| ts     | TIMESTAMPTZ      | -       | ✔        | Timestamp associated with stock price                |
| open   | DOUBLE PRECISION | -       | ✔        | Opening price of candlestick                         |
| high   | DOUBLE PRECISION | -       | ✔        | High price of candlestick                            |
| low    | DOUBLE PRECISION | -       | ✔        | Low price of candlestick                             |
| close  | DOUBLE PRECISION | -       | ✔        | Closing price of candlestick                         |
| volume | DOUBLE PRECISION | -       | ✔        | Total volume of trades during the candlestick period |

## Returns

| Column | Type        | Description                                                                                                                                                                                           |
| ------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agg    | Candlestick | 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. |
