Skip to main content

input, input_group

Input

The input function is here for you to add more details to your indicator with the help of the customized features. The input function declares a parameter setting of a certain indicator, so you can have the ability to configure this parameter in the traderoom user interface. The values can vary widely, as this function is a general declaration of any new feature of the indicator.

Syntax Format

fill_color = input { default = rgba(86,206,255,0.15), type = input.color }

In the traderoom such an input parameter can be displayed in the settings:

image.png

Input Group

The input_group helps you create blocks of settings, similar in purpose, to structure the script code and make it easier to read and alter if necessary.

Syntax Format

For example, you can use the Input Group function to enable visual settings to the indicator:

input_group {
"Top Box",
top_color = input { default = "#25E154", type = input.color },
top_width = input { default = 1, type = input.line_width}
}
input_group {
"Bottom Box",
bottom_color = input { default = "#FF6C58", type = input.color },
bottom_width = input { default = 1, type = input.line_width}
}

You can also include the calculations into the input-group function:

input_group {
"Balance of Power Smoothed Line",
period = input (14, "period", input.integer, 1, 200),
fn = input (1, "Average", input.string_selection, averages.titles),
}

In the traderoom such settings are displayed in the Basic settings section:

image.png