input.int

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. Read the note on step before you use it: naming that argument does not parse.

input.int(const int defval, const string title, const int minval, const int maxval, const int step, const string tooltip, const string inline, const string group, const bool confirm) → input int
ParameterTypeRequiredDescription
defvalconst intyesThe number the control starts at. Required.
titleconst stringnoThe label shown beside the control.
minvalconst intnoThe lowest value accepted. May be na to mean unbounded.
maxvalconst intnoThe highest value accepted. May be na to mean unbounded.
stepconst intnoThe size of one increment. May be na to mean unstepped. It can only be passed positionally — step is a word the grammar reserves for counted loops, so writing step = 5 is a parse error.
tooltipconst stringnoHelp text for the control.
inlineconst stringnoA key that puts several controls on one row.
groupconst stringnoA heading the control sits under.
confirmconst boolnoAsks the reader to confirm the value.

Returns input int — An input int.

indicator("Length input")
plot(talib.sma(close, input.int(20, "Length")))

See also inputs · input.bool · input.color · input.float

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade