float
Adds a floating-point number field to your indicator’s Inputs panel. Useful for decimal values like thresholds, multipliers, percentages, or coefficients. Like int(), you can define minimum, maximum, and step values to constrain what the user can enter.
Syntax
input.float(title, value, id?, min?, max?, step?, tooltip?, group?, inline?)
Parameters
title
string— Label shown in the Inputs panel.value
number— Default decimal value.id
string(optional) — Unique key for referencing this input. Auto-generated fromtitleif omitted (lowercased, no spaces).min
number(optional) — Minimum allowed value.max
number(optional) — Maximum allowed value.step
number(optional) — Increment between values (e.g.,0.1→ values like 0.1, 0.2, 0.3).tooltip
string(optional) — Hover text that explains the parameter.group
string(optional) — Organizes this input under a collapsible section.inline
string(optional) — Aligns multiple inputs in one row if they share the sameinlinekey.
Return Value
{ id: string } — The assigned id, either provided or auto-generated.
Example
Result

Tips
Use
stepvalues like0.1or0.01to make fine-tuning easy for users.Keep default values practical (e.g.,
1.5for ATR multipliers is a common starting point).
Warning
Without min and max, users can enter extreme values that may break your logic.
Always validate in your code if ranges matter.
Last updated