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…)

signature
int(label: string, def: number, o?: { min?: number; max?: number } & InputOptions): number
example
const len = input.int('Length', 14, { min: 2, max: 200 })

input.number

A number the user can change

signature
number(label: string, def: number, o?: { min?: number; max?: number; step?: number } & InputOptions): number
example
const mult = input.number('Multiplier', 2, { step: 0.1 })

input.bool

An on/off switch

signature
bool(label: string, def: boolean, o?: InputOptions): boolean
example
const show = input.bool('Show signals', true)

input.select

A choice from a list (of strings or numbers)

signature
select<T extends string | number>(label: string, options: T[], def: T, o?: InputOptions): T
example
const kind = input.select('Type', ['EMA', 'SMA'], 'EMA')

input.source

Which price to use (close, open…)

signature
source(label: string, def?: 'close' | 'open' | 'high' | 'low' | 'hl2' | 'hlc3' | 'ohlc4' | 'hlcc4', o?: InputOptions): Series
example
const src = input.source('Source', 'close')

input.text

Text the user types (e.g. a list like '1,3,6'); up to 200 characters

signature
text(label: string, def?: string, o?: InputOptions): string
example
const list = input.text('Lines', '1,3,6')

input.color

A color the user picks

signature
color(label: string, def: Color, o?: InputOptions): Color
example
const c = input.color('Line color', color.orange, { group: 'Style' })

input.timeframe

An interval the user picks (for request.bars); default '1D'

signature
timeframe(label: string, def?: Timeframe, o?: InputOptions): Timeframe
example
const tf = input.timeframe('Higher timeframe', '240')

input.symbol

A market the user picks ('BINANCEF:ETHUSDT', exchange:symbol), for request.bars / request.data

signature
symbol(label: string, def: string, o?: InputOptions): string
example
const 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, …

signature
time(label: string, def: number | string, o?: InputOptions): number
example
const from = input.time('Anchor', '2026-01-01T00:00:00Z')

npm · GitHub