# Stock charts

The 5 tools for stock charts. Before an agent first makes one, it reads guide topic stocks.

## find_tickers

Find stocks, ETFs, indexes, funds and crypto by name or symbol for a stock chart ("nvidia", "S&P 500", "vanguard total market", "bitcoin"): their symbol, name, exchange and type.

Parameters:
- `query` (string, required)
- `limit` (integer)

## create_stock_chart

Make a stock chart in a space: tickers with their live price and change, a chart over a range (a day to their whole history: area, line or candles, with volume; two tickers or more compared in % change), and a table under it of every ticker (price, day change, day and 52-week range, volume) and of the chart's bars. People switch the range and chart, pick a ticker, and comment on one. The prices are real and fetched when people look; you give only the tickers and how it opens. Read guide topic "stocks" first.

Parameters:
- `space_id` (string, required)
- `title` (string, required)
- `subtitle` (string): One line under the title: what these are and why.
- `tickers` (object[], required)
- `range` (string): The range it opens on: 1d (today, 5-minute bars), 5d, 1mo, 6mo, ytd, 1y, 5y or max. People switch it.
- `chart` (string): area (default), line, or candles (open, high, low, close). With two tickers or more, the chart compares them in % change.

## read_stock_chart

A stock chart's settings and tickers (with the ids update_stock_chart and comment take), each ticker's price now (change on the previous close, day and 52-week range, volume, whether its market is open) and its change over the chart's range (with that range's high and low). Use it to write about the prices; quote it, never guess it.

Parameters:
- `item_id` (string, required)
- `prices` (boolean): false: only the settings and tickers.

## update_stock_chart

Change a stock chart. Any of: title, subtitle, range, chart; add (new tickers, after the others); change (by id: name, note; "" clears a note); remove (ids or symbols); order (every id, in the new order). Applied in that order; read_stock_chart first for the ids.

Parameters:
- `item_id` (string, required)
- `title` (string)
- `subtitle` (string)
- `range` (string): The range it opens on: 1d (today, 5-minute bars), 5d, 1mo, 6mo, ytd, 1y, 5y or max. People switch it.
- `chart` (string): area (default), line, or candles (open, high, low, close). With two tickers or more, the chart compares them in % change.
- `add` (object[])
- `change` (object[])
- `remove` (string[])
- `order` (string[])

## render_stock_chart

See a stock chart as people do: a screenshot of its header, chart and table at a range, with one ticker picked. Plus what the page reports (tickers shown, tickers without prices, the range and bars drawn) and errors it hit.

Parameters:
- `item_id` (string, required)
- `range` (string): Show this range instead of the one it opens on.
- `ticker` (string): Pick this ticker (its id or symbol) in the header and the table.
- `table` (string): Show this tab of the table: tickers (default) or history (the chart's bars).
