input
<T extends string>(label: string, defaultValue: T, choices: readonly T[], options?: InputOptions & { labels?: Partial<Record<T, string>> }): T
One of a fixed list of strings.
labels names values for the settings panel and the legend,
such as { lastHour: 'Last hour' }, so the values can stay stable while the words change.Which bar value to read, such as
close or hl2. Read it with bars().source(name).A colour;
null follows the theme.A moment the user picks by clicking the chart, such as an anchored VWAP’s start.
null until picked.An interval code.
'chart' stands for the chart’s own interval, as a default and as the
user’s choice: the script then reads the chart’s code ('15m' on a 15-minute chart), and a
bars({ interval }) stream with it is the chart’s own stream.A market symbol such as
BTC or xyz:GOLD; null means the chart’s market.A list of wallet addresses, lower-case hex.
A list of market symbols, such as a basket for
ml.pca: at most 50, trimmed, without repeats.
Open one stream per market with markets.map((m) => bars({ market: m })).(label: string, defaultValue: number | null, options?: InputOptions & { drag?: boolean }): number | null
An algo’s price: a number field, and with
drag: true a line on the chart the trader drags, as the
ticket’s TP/SL. A null default is an empty field, for an optional price; it reads null until set.An algo’s size: an amount and its unit ($, coins, % of the position, % of equity), as the ticket’s size.
A percent, such as a price band.
A length of time written as the trader writes it (
'30s', '5m', '4h', '2d'), read in seconds.InputOptions
false keeps the input’s value out of the script’s name in the legend, which otherwise
carries its numbers, sources, choices and intervals (“RSI 14 close”). For a setting that
says where something draws rather than what it computes, such as a table’s corner.NumberInputOptions
For
int and float: what the number counts, written in its field ('usd' dollars, 'bps' basis points).