Lipi Reference Lipi

Functions

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.

Syntax

                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
              

Arguments

defval required const int The number the control starts at. Required.
title const string The label shown beside the control.
minval const int The lowest value accepted. May be `na` to mean unbounded.
maxval const int The highest value accepted. May be `na` to mean unbounded.
step const int The 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.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input int

Example


          indicator("Custom High-Low Offset", overlay=true)
offset = input.int(2, title="Offset Value", minval=1)
plot(high + offset, color=color.green, title="High Offset")
plot(low - offset, color=color.red, title="Low Offset")