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 · 1 of 2
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 Determines the default value of the input variable proposed in the script's "Settings/Inputs" tab, from where script users can change it. When a list of values is used with the options parameter, the value must be one of them. title const string Title of the input. If not specified, the variable name is used as the input's title. If the title is specified, but it is empty, the name will be an empty string. minval const int Minimal possible value of the input variable. Optional. maxval const int Maximum possible value of the input variable. Optional. step const int Step value used for incrementing/decrementing the input. Optional. The default is 1. tooltip const string The string that will be shown to the user when hovering over the tooltip icon. inline const string Combines all the input calls using the same argument in one line. The string used as an argument is not displayed. It is only used to identify inputs belonging to the same line. group const string Creates a header above all inputs using the same group argument string. The string is also used as the header's text confirm const bool Return Type
input int Syntax · 2 of 2
input.int(const int defval, const string title, const [int...] options, const string tooltip, const string inline, const string group, const bool confirm) → input int
Arguments
defval required const int Determines the default value of the input variable proposed in the script's "Settings/Inputs" tab, from where script users can change it. When a list of values is used with the options parameter, the value must be one of them. title const string Title of the input. If not specified, the variable name is used as the input's title. If the title is specified, but it is empty, the name will be an empty string. options [const int...] tooltip const string The string that will be shown to the user when hovering over the tooltip icon. inline const string Combines all the input calls using the same argument in one line. The string used as an argument is not displayed. It is only used to identify inputs belonging to the same line. group const string Creates a header above all inputs using the same group argument string. The string is also used as the header's text confirm const bool Return Type
input int Example
//@lipi=2
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")