input.* reference

Each input.* declaration renders a control in the editor’s Inputs panel; changing a value re-runs the script. The general shape is input.<kind>(default, title?, …).

input.num

input.num(default, title?, min:, max:) → number

A numeric input — renders as a number field (with optional min/max bounds).

defaultnumberInitial value.
titletext?Label shown in the Inputs panel.
min / maxnumber?Named bounds, e.g. `min: 2, max: 200`.

Returns: number

PulseScript
pulse 1
len = input.num(20, "Length", min: 2, max: 200)
draw line(sma(close, len), title: "SMA")

input.source

input.source(default) → series

A price-series picker — lets the user choose close / open / high / low / hl2 / hlc3 / etc.

defaultseriesDefault price series, e.g. `close`.

Returns: price series

PulseScript
pulse 1
src = input.source(close)
draw line(ema(src, 20), title: "EMA of source")

input.bool

input.bool(default, title?) → bool

A toggle switch.

defaultboolInitial on/off.
titletext?Label.

Returns: bool

PulseScript
pulse 1
showMarks = input.bool(true, "Show signals")
when showMarks and crossOver(ema(close, 9), ema(close, 21)): mark buy at low "Long"

input.text

input.text(default, title?) → text

A free-text input — handy for custom mark/alert labels.

defaulttextInitial string.
titletext?Label.

Returns: text

PulseScript
pulse 1
label = input.text("Long", "Buy label")
when crossOver(ema(close, 9), ema(close, 21)): mark buy at low label

input.select

input.select(default, title?, options: [...]) → text

A dropdown of fixed choices.

defaulttextDefault option (must be in the list).
titletext?Label.
optionstext[]Named list of choices, e.g. `options: ["fast", "slow"]`.

Returns: text (the chosen option)

PulseScript
pulse 1
mode = input.select("fast", "Mode", options: ["fast", "slow"])
len = mode == "fast" ? 9 : 21
draw line(ema(close, len), title: "EMA")

input.color

input.color(default, title?) → color

A colour picker — feed the result into any output’s `color:` argument.

defaultcolorDefault colour string, e.g. `"#38bdf8"`.
titletext?Label.

Returns: color string

PulseScript
pulse 1
col = input.color("#38bdf8", "Line colour")
draw line(sma(close, 20), color: col, title: "SMA")