Candlestick Chart

Category: Charts

Live preview
Daily price, January 2024
Up: close at or above open (hollow)Down: close below open (filled)
Price (USD)
96
98
100
102
104
106
10,000
0
Jan 07
Jan 14
DateOpenHighLowCloseDirectionVolume
2024-01-01100 USD100.84 USD99.1 USD100.39 USDUp3,693
2024-01-02100.39 USD101.43 USD99.22 USD99.72 USDDown7,227
2024-01-0399.72 USD101.84 USD98.23 USD101.69 USDUp1,924
2024-01-04101.69 USD105.06 USD100.22 USD103.6 USDUp9,731
2024-01-05103.6 USD104.1 USD102.2 USD102.57 USDDown3,997
2024-01-06102.57 USD103.73 USD101.43 USD101.94 USDDown7,966
2024-01-07101.94 USD104.74 USD100.58 USD103.56 USDUp8,106
2024-01-08103.56 USD103.57 USD101.62 USD101.65 USDDown1,088
2024-01-09101.65 USD102.73 USD100.73 USD101.38 USDDown7,496
2024-01-10101.38 USD102.06 USD100.5 USD101.72 USDUp3,048
2024-01-11101.72 USD102.57 USD99.74 USD99.75 USDDown6,072
2024-01-1299.75 USD101.11 USD98.14 USD98.37 USDDown9,145
2024-01-1398.37 USD99.24 USD97.54 USD98.57 USDUp5,016
2024-01-1498.57 USD101.27 USD97.12 USD100.43 USDUp6,019
2024-01-15100.43 USD102.35 USD99.22 USD101.66 USDUp5,150
2024-01-16101.66 USD102.25 USD100.73 USD101.37 USDDown4,545
2024-01-17101.37 USD102.85 USD100.14 USD102.64 USDUp2,233
2024-01-18102.64 USD105.08 USD101.39 USD103.98 USDUp7,610
2024-01-19103.98 USD104.67 USD103.03 USD104.51 USDUp1,942
2024-01-20104.51 USD105.88 USD103.27 USD103.73 USDDown9,214

Price movement as open-high-low-close bars on a date axis, drawn on the server as static HTML with no script. With the default style "candle" each bar is a wick from low to high and a body from open to close; with style "ohlc" it is a stem with a tick to the left for the open and a tick to the right for the close. Direction never rests on colour alone: a bar that closes at or above its open is hollow (candle) or a thin bar (ohlc) in the --positive colour, one that closes lower is filled (candle) or a thick bar (ohlc) in the --negative colour, a legend says so in words, and the hidden table has a Direction column. Bars sit at their real dates (weekend gaps show as gaps), the date axis ticks and labels follow d3-scale scaleUtc and d3-time-format, and the price axis follows d3 nice() and ticks(). An optional volume panel under the price panel repeats the hollow or filled cue. A hidden table gives every value. Motion-ready: each bar fades in through --k from --p (build progress 0 to 1, default 1); the standalone render is the finished picture and reduced motion shows the end state.

Surfaces
webgoogle-apps-script-webmcp-appsandroid
Degraded on
SurfaceNote
pdfPrints the finished picture; no motion
Fields
FieldTypeRequired
titlestring (optional, max 80).optional
datesarray (required, up to 10000 read) of ISO date strings, read as UTC: "2024-03-05", or with a time "2024-03-05T09:30", "2024-03-05 09:30:15" or "2024-03-05T09:30:15.250Z". Years 1000 to 9000. Any other string, a time zone offset or a non-string leaves that bar out with a note. The bars are drawn in date order.required
openarray (required) of numbers, one per date, each finite and up to 1e12 in size.required
higharray (required) of numbers, one per date. Must be at least the open, close and low.required
lowarray (required) of numbers, one per date. Must be at most the open, close and high.required
closearray (required) of numbers, one per date.required
volumearray of numbers of 0 or more, one per date. Adds a volume panel; a bar without a usable volume has no volume bar and a note counts them.optional
stylestring (optional, "candle" or "ohlc", default "candle"). Any other value draws candles.optional
unitstring (optional, max 12). Appended to the price values in the aria label and the hidden table.optional
y_labelstring (optional, max 40). Names the price axis above the chart.optional
versioninteger (optional, default 1). The candlestick_chart contract the payload was written for. Only version 1 exists; a higher whole number is drawn as version 1 with a note.optional
Example payload
{
  "type": "candlestick_chart",
  "dates": [],
  "open": 1,
  "high": 1,
  "low": 1,
  "close": 1
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:candlestick_chart",
  "displayName": "Candlestick Chart",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/candlestick_chart/",
  "capabilities": [
    "web",
    "google-apps-script-web",
    "mcp-apps",
    "android"
  ],
  "description": "Price movement as open-high-low-close bars on a date axis, drawn on the server as static HTML with no script. With the default style \"candle\" each bar is a wick from low to high and a body from open to close; with style \"ohlc\" it is a stem with a tick to the left for the open and a tick to the right for the close. Direction never rests on colour alone: a bar that closes at or above its open is hollow (candle) or a thin bar (ohlc) in the --positive colour, one that closes lower is filled (candle) or a thick bar (ohlc) in the --negative colour, a legend says so in words, and the hidden table has a Direction column. Bars sit at their real dates (weekend gaps show as gaps), the date axis ticks and labels follow d3-scale scaleUtc and d3-time-format, and the price axis follows d3 nice() and ticks(). An optional volume panel under the price panel repeats the hollow or filled cue. A hidden table gives every value. Motion-ready: each bar fades in through --k from --p (build progress 0 to 1, default 1); the standalone render is the finished picture and reduced motion shows the end state.",
  "representativeQueries": [
    "show a candlestick_chart: open-high-low-close price bars over time",
    "price movement as open-high-low-close bars on a date axis, drawn on the server as static html with n",
    "render a candlestick chart"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →