input value is required, such as hline(price) and plot(linewidth=...).
input(defval, ...) picks the kind from the type of defval (bool, color, int, float, string, or a series for a source).
Common arguments
Afterdefval, every input takes title, tooltip (help text), inline (inputs with the same string share one row), group
(inputs with the same string sit under one heading), confirm and display. All are const. defval is const too, except for
input.source, and it may not be na:
defval of input.int() cannot be na.
step may be named: input.int(14, "Length", step=5) works. The compiler does not check that defval lies between minval and
maxval. input.int takes only an int default (5.5 is refused); input.float accepts 5.
display takes display.* constants, combined with +, and only tells the platform where to show the value; the script never
sees it. Its default is display.none for input.bool, input.color, input.text_area and input.time, and display.all for every other input
(int, float, string, source, price, session, timeframe, enum).
Options
options=[...] turns a number or string input into a list. The default must be one of the options:
defval of input.int() value 10 is not in options [7, 14, 21].
Time
input.time takes milliseconds since 1970 (UTC). A default written as timestamp("2024-01-01") passes the editor’s check and fails
when the script is added to the chart, because timestamp is evaluated only when the script runs and is na until then:
defval of input.time() cannot be na. Give the number instead, or build the
date from three integer inputs, which are evaluated when the script runs:
Enum
input.enum(defval, title, options, ...) takes a member of an enum you declared (see
Custom types and enums); the member’s title is the text of the control. options lists the
members offered and must contain defval.
input.source accepts names, not expressions
The default ofinput.source must be one of the eight price series above: input.source(talib.sma(close, 3)) is refused as not a valid source variable.