Input
input
input
Definition: Adds an input to the Inputs tab of your script's Settings, which allows you to provide configuration options to script users. This function automatically detects the type of the argument used for 'defval' and uses the corresponding input widget.
Syntax:
Returns:
Arguments:
Name | Type | Description |
---|---|---|
| (const int/float/bool or source-type built-ins) | Determines the default value of the input variable proposed in the script's "Settings/Inputs" tab, from where script users can change it. Source-type built-ins are built-in series float variables that specify the source of the calculation: |
| 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. |
Example:
input.source
input.source
Definition: Adds an input to the Inputs tab of your script's Settings, which allows you to provide configuration options to script users. This function adds a dropdown that allows the user to select a source for the calculation, e.g. close, hl2, etc. The user can also select an output from another indicator on their chart as the source.
Syntax:
Returns:
Arguments:
Name | Type | Description |
---|---|---|
| (open/high/low/close/hl2/hlc3/ohlc4/hlcc4) | Determines the default value of the input variable proposed in the script's "Settings/Inputs" tab, from where the user can change it. |
| 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. |
Example:
Remarks: Result of input.source function always should be assigned to a variable, see examples above.
input.float
input.float
input.float
is used to add an input to the Inputs tab of your script's Settings, which provides configuration options to script users. This function adds a field for a float input to the script's inputs.
Syntax:
Returns:
Arguments:
Name | Type | Description |
---|---|---|
| const int/float | 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 |
| const string | Title of the input. |
| const int/float | Minimal possible value of the input variable. Optional. |
| const int/float | Maximum possible value of the input variable. Optional. |
| const int/float | Step value used for incrementing/decrementing the input. Optional. The default is 1. |
Example:
input.int
input.int
input.int
is used to add an input to the Inputs tab of your script's Settings, which provides configuration options to script users. This function adds a field for an integer input to the script's inputs.
Syntax:
Returns:
Arguments:
Name | Type | Description |
---|---|---|
| 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 |
| const string | Title of the input. |
| const int | Minimal possible value of the input variable. Optional. |
| const int | Maximum possible value of the input variable. Optional. |
| const int | Step value used for incrementing/decrementing the input. Optional. The default is 1. |
Example:
input.session
input.session
input.session
is used to add an input to the Inputs tab of your script's Settings, which provides configuration options to script users. This function adds two dropdowns that allow the user to specify the beginning and end of a session.
Syntax:
Returns:
Arguments:
Name | Type | Description |
---|---|---|
| const string | 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 |
| const string | Title of the input. |
Example:
input.bool
input.bool
Definition: Adds an input to the Inputs tab of your script's Settings, which allows you to provide configuration options to script users. This function adds a checkmark to the script's inputs.
Syntax:
Returns:
Arguments:
Name | Type | Description |
---|---|---|
| const bool | Determines the default value of the input variable proposed in the script's "Settings/Inputs" tab, from where the user can change it. |
| const string | Title of the input. |
Example:
Last updated