Candle Chart
Type:
candle_chart
• Category:visualization
Description
Store OHLC candlestick data for chart widget
Parameters
Name | Type | Description | Required | Default |
---|---|---|---|---|
widgetId | string | no | ||
rowsExpr | string | Expr -> list[dict] (each dict: ts, o, h, l, c) | no | |
columns | array | Optional list of columns (ts, o, h, l, c) | no | |
open | string | no | ||
close | string | no | ||
high | string | no | ||
low | string | no | ||
volume | string | no | ||
timestamp | string | no | ||
limit | number | no | 500 |
Help
Overview
This worker stores Open‑High‑Low‑Close (OHLC) candlestick data for a chart widget. It receives a list of price‑time records, optionally filters the columns, and saves the processed data under the specified widget identifier.
Inputs
- widgetId (
string
) – Unique identifier of the chart widget that will receive the data. - rowsExpr (
string
) – An expression that evaluates to a list of dictionaries, each containing the fieldsts
,o
,h
,l
,c
. These represent timestamp, open, high, low, and close values respectively. - columns (
array
, optional) – List of column names to retain from each row. Acceptable values are any subset ofts
,o
,h
,l
,c
. If omitted, all columns are stored. - open (
string
) – Name of the field that holds the opening price (default:o
). - close (
string
) – Name of the field that holds the closing price (default:c
). - high (
string
) – Name of the field that holds the highest price (default:h
). - low (
string
) – Name of the field that holds the lowest price (default:l
). - volume (
string
) – Name of the field that holds the traded volume, if present. - timestamp (
string
) – Name of the field that holds the timestamp (default:ts
). - limit (
number
, default = 500) – Maximum number of rows to store. Excess rows are truncated.
Minimal Example Usage
widgetId: "chart-123"
rowsExpr: "fetchCandles('AAPL', '1h', 1000)" # returns a list of dicts with ts, o, h, l, c
columns: ["ts", "o", "h", "l", "c"]
open: "o"
close: "c"
high: "h"
low: "l"
timestamp: "ts"
limit: 300
In this example the worker retrieves 1‑hour OHLC candles for the ticker AAPL, keeps only the standard five columns, and stores up to 300 rows under the widget identified by "chart-123"
.