int
Adds an integer number field to your indicator’s Inputs panel. Perfect for whole-number settings like “Period”, “Length”, or “Bars to look back”. You can define minimum, maximum, and step values to restrict user input.
Syntax
input.int(title, value, id?, min?, max?, step?, tooltip?, group?, inline?)
Parameters
title
string— Label shown in the Inputs panel.value
number— Default integer value.id
string(optional) — Unique key for referencing this input. Auto-generated fromtitleif omitted (lowercased, spaces removed).min
number(optional) — Minimum allowed value.max
number(optional) — Maximum allowed value.step
number(optional) — Increment between values (e.g.,5→ values like 5, 10, 15).tooltip
string(optional) — Hover text for UI guidance.group
string(optional) — Groups related inputs into collapsible sections.inline
string(optional) — Aligns multiple inputs in the same row if they share the sameinlinekey.
Return Value
{ id: string } — The assigned id, either custom or auto-generated.
Example
Result

Tips
Use
minandmaxto prevent invalid values (e.g., period length must be >0).Adding a
stepmakes the spinner more user-friendly (e.g., jump in multiples of 5).
Warning
If you don’t constrain min/max, users can enter any number. Always validate in your logic if limits are important.
Last updated