Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: input · Entries: 15
input (library)
Definition
Twelve functions, one per kind of setting the reader can change from the chart: bool, colour, enum, float, int, price, session, source, string, text area, time and timeframe.
A value that came from one of these carries the input form — you never write that qualifier, the call produces it.
Example
input.bool (function)
Definition
Offers the reader a true-or-false setting and hands back what they chose.
One of twelve input functions, one per kind of control. Only defval is required.
Syntax
Returns
input bool
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.bool()cannot bena.” Any constant expression of type bool is accepted, such astrue.
input.color (function)
Definition
Asks the reader for a colour.
Pass the result straight to a colour argument of a chart-output call; those arguments accept an input-form colour.
Syntax
Returns
input color
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.color()cannot bena.” Any constant expression of type color is accepted, such ascolor.redorcolor.new(color.red, 0.5).
input.enum (function)
Definition
Adds a dropdown setting whose choices are the members of an enum you declare. It returns the chosen member, so the script can compare it with the members directly.
Each member’s title, the text after = in the enum declaration, is what the reader sees in the dropdown. options can limit the dropdown to some of the members.
Syntax
Returns
input enum
Example
input.float (function, overload 1)
Definition
The decimal counterpart of input.int, with the same arguments and const float in place of const int.
minval, maxval and step may each be given by name, as in input.float(2.0, "Mult", step=0.5).
Syntax
Returns
input float
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.float()cannot bena.” Any constant expression of type float is accepted, such as-5.5or2.5 * 2.
input.float (function, overload 2)
Definition
The decimal counterpart of input.int, with the same arguments and const float in place of const int.
minval, maxval and step may each be given by name, as in input.float(2.0, "Mult", step=0.5).
Syntax
Returns
input float
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.float()cannot bena.” Any constant expression of type float is accepted, such as-5.5or2.5 * 2.
input.int (function, overload 1)
Definition
A whole-number setting, with optional bounds and an optional increment.
It and input.float are the only two input functions that take minval, maxval and step; each may be given by name, as in input.int(14, "Length", minval=1, step=2).
Syntax
Returns
input int
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.int()cannot bena.” Any constant expression of type int is accepted, such as-5or2 * 3.
input.int (function, overload 2)
Definition
A whole-number setting, with optional bounds and an optional increment.
It and input.float are the only two input functions that take minval, maxval and step; each may be given by name, as in input.int(14, "Length", minval=1, step=2).
Syntax
Returns
input int
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.int()cannot bena.” Any constant expression of type int is accepted, such as-5or2 * 3.
input.price (function)
Definition
A price setting. The value comes back as a float.
Unlike input.float it takes no bounds and no step, so use input.float where a range matters.
Syntax
Returns
input float
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.price()cannot bena.” Any constant expression of type float is accepted, such as100.5or2.5 * 2.
input.session (function)
Definition
Asks the reader for a session and gives you back a string.
The string is a session in the form that time() reads: HHMM-HHMM on a 24-hour clock, such as “0930-1600”. Join ranges with commas, as in “1000-1100,1400-1500”. Add : and the digits 1 to 7 to limit the session to days, Sunday being 1, as in “0930-1600:23456”. A range that ends before it starts wraps past midnight, and “0000-0000” is the whole day.
Syntax
Returns
input string
Example
input.source (function)
Definition
Lets the reader pick which series the script reads — the close, the high, a midpoint, and so on.
It is the exception in this namespace: it returns a series float rather than an input-form value, so what you get back can differ on every bar.
Syntax
Returns
series float
Example
input.string (function)
Definition
A one-line text setting.
For a longer piece of text, reach for input.text_area instead; both return an input string.
Syntax
Returns
input string
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.string()cannot bena.” Any constant expression of type string is accepted, such as"a" + "b".
input.text_area (function)
Definition
A multi-line text setting, for a message or a note rather than a single word.
Syntax
Returns
input string
Example
input.time (function)
Definition
A time setting, returned as an int.
The date functions take a time and a timezone, so a value from here can be fed to hour, year and the rest.
Syntax
Returns
input int
Notes
- The default
defvalmust be a value:nais rejected with “Argumentdefvalofinput.time()cannot bena.” Any constant expression of type int that gives a time in milliseconds is accepted, such as1700000000000or1000 * 60 * 60.
input.timeframe (function)
Definition
Asks the reader for a timeframe. The answer arrives as a string.
Note what it is not: choosing a timeframe here does not fetch that timeframe’s data. Lipi has no way to request another symbol’s or another interval’s series.
Syntax
Returns
input string
Example