Functions
Inputs
10 names in this group.
Each comes with its signature and an example.
input.int
A whole number the user can change (a period…)
int(label: string, def: number, o?: { min?: number; max?: number } & InputOptions): numberconst len = input.int('Length', 14, { min: 2, max: 200 })input.number
A number the user can change
number(label: string, def: number, o?: { min?: number; max?: number; step?: number } & InputOptions): numberconst mult = input.number('Multiplier', 2, { step: 0.1 })input.bool
An on/off switch
bool(label: string, def: boolean, o?: InputOptions): booleanconst show = input.bool('Show signals', true)input.select
A choice from a list (of strings or numbers)
select<T extends string | number>(label: string, options: T[], def: T, o?: InputOptions): Tconst kind = input.select('Type', ['EMA', 'SMA'], 'EMA')input.source
Which price to use (close, open…)
source(label: string, def?: 'close' | 'open' | 'high' | 'low' | 'hl2' | 'hlc3' | 'ohlc4' | 'hlcc4', o?: InputOptions): Seriesconst src = input.source('Source', 'close')input.text
Text the user types (e.g. a list like '1,3,6'); up to 200 characters
text(label: string, def?: string, o?: InputOptions): stringconst list = input.text('Lines', '1,3,6')input.color
A color the user picks
color(label: string, def: Color, o?: InputOptions): Colorconst c = input.color('Line color', color.orange, { group: 'Style' })input.timeframe
An interval the user picks (for request.bars); default '1D'
timeframe(label: string, def?: Timeframe, o?: InputOptions): Timeframeconst tf = input.timeframe('Higher timeframe', '240')input.symbol
A market the user picks ('BINANCEF:ETHUSDT', exchange:symbol), for request.bars / request.data
symbol(label: string, def: string, o?: InputOptions): stringconst other = input.symbol('Compare with', 'BINANCEF:ETHUSDT')input.time
A moment the user picks (UTC ms); the default is a number or a date like '2026-01-01T00:00:00Z'. For an anchored VWAP's start, …
time(label: string, def: number | string, o?: InputOptions): numberconst from = input.time('Anchor', '2026-01-01T00:00:00Z')