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