> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# input functions

> Reference for the 12 functions (14 entries with overloads) of the input namespace: input.bool, input.color, input.enum, input.float and 8 more, each with its definition and an example.

> [!NOTE]
>
> Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: input · Entries: 15

## `input` (library)

**Definition**

Twelve functions, one per kind of setting the reader can change from the chart: bool, colour, enum, float, int, price, session, source, string, text area, time and timeframe.

A value that came from one of these carries the `input` form — you never write that qualifier, the call produces it.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("input Library Example", overlay=true)
length = input.int(20, title="Length", minval=1)
src = input.source(close, title="Source")
showBands = input.bool(true, title="Show Bands")
lineColor = input.color(color.blue, title="Line Colour")
basis = talib.sma(src, length)
plot(basis, title="Basis", color=lineColor)
plot(showBands ? basis + talib.stdev(src, length) * 2 : na, title="Upper", color=color.gray)
plot(showBands ? basis - talib.stdev(src, length) * 2 : na, title="Lower", color=color.gray)
```

## `input.bool` (function)

**Definition**

Offers the reader a true-or-false setting and hands back what they chose.

One of twelve input functions, one per kind of control. Only `defval` is required.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.bool(const bool defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input bool
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const bool` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.none`: the value is shown only in the settings. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.none` |

**Returns**

`input bool`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.bool()` cannot be `na`." Any constant expression of type bool is accepted, such as `true`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Boolean Input Example", overlay=true)
showSMA = input.bool(true, title="Show SMA")
sma_value = talib.sma(close, 14)
plot(showSMA ? sma_value : na, title="SMA", color=color.blue, linewidth=2)
```

## `input.color` (function)

**Definition**

Asks the reader for a colour.

Pass the result straight to a colour argument of a chart-output call; those arguments accept an input-form colour.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.color(const color defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input color
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const color` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.none`: the value is shown only in the settings. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.none` |

**Returns**

`input color`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.color()` cannot be `na`." Any constant expression of type color is accepted, such as `color.red` or `color.new(color.red, 0.5)`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Custom SMA", overlay=true)
smaColor = input.color(color.blue, title="SMA Color")
plot(talib.sma(close, 14), color=smaColor)
```

## `input.enum` (function)

**Definition**

Adds a dropdown setting whose choices are the members of an enum you declare. It returns the chosen member, so the script can compare it with the members directly.

Each member's title, the text after `=` in the enum declaration, is what the reader sees in the dropdown. `options` can limit the dropdown to some of the members.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.enum(const enum defval, const string title, [const enum...] options, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input enum
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const enum` | yes | The enum member used as the default value. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `options` | `[const enum...]` | no | The enum members the dropdown is limited to. | | |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input enum`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("input.enum Example", overlay=true)
enum Source {
    ClosePrice = "Close"
    MidPrice = "High/Low Midpoint"
}
src = input.enum(Source.ClosePrice, "Price Source")
price = src == Source.ClosePrice ? close : hl2
plot(talib.sma(price, 20), title="SMA", color=color.blue)
```

## `input.float` (function, overload 1)

**Definition**

The decimal counterpart of `input.int`, with the same arguments and `const float` in place of `const int`.

`minval`, `maxval` and `step` may each be given by name, as in `input.float(2.0, "Mult", step=0.5)`.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.float(const float defval, const string title, const float minval, const float maxval, const float step, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input float
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const float` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `minval` | `const float` | no | Minimal possible value of the input variable. Optional. | | `na` |
| `maxval` | `const float` | no | Maximum possible value of the input variable. Optional. | | `na` |
| `step` | `const float` | no | The amount the value changes by in the settings' up and down buttons. Optional. The default is 1. | | `1` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input float`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.float()` cannot be `na`." Any constant expression of type float is accepted, such as `-5.5` or `2.5 * 2`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("float")
multiplier = input.float(2.0, title="Multiplier")
atr = talib.atr(14) * multiplier
plot(atr, color=color.blue, title="ATR Multiplied")
```

## `input.float` (function, overload 2)

**Definition**

The decimal counterpart of `input.int`, with the same arguments and `const float` in place of `const int`.

`minval`, `maxval` and `step` may each be given by name, as in `input.float(2.0, "Mult", step=0.5)`.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.float(const float defval, const string title, [const float...] options, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input float
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const float` | yes | Default value of the input. The reader can change it from the chart. When `options` is given, `defval` must be one of its values. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `options` | `[const float...]` | no | List of values the reader can choose from. The value of `defval` must be one of them. | | |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input float`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.float()` cannot be `na`." Any constant expression of type float is accepted, such as `-5.5` or `2.5 * 2`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("float")
multiplier = input.float(2.0, title="Multiplier")
atr = talib.atr(14) * multiplier
plot(atr, color=color.blue, title="ATR Multiplied")
```

## `input.int` (function, overload 1)

**Definition**

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`; each may be given by name, as in `input.int(14, "Length", minval=1, step=2)`.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
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, const display display) → input int
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const int` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `minval` | `const int` | no | Minimal possible value of the input variable. Optional. | | `na` |
| `maxval` | `const int` | no | Maximum possible value of the input variable. Optional. | | `na` |
| `step` | `const int` | no | The amount the value changes by in the settings' up and down buttons. Optional. The default is 1. | | `1` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input int`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.int()` cannot be `na`." Any constant expression of type int is accepted, such as `-5` or `2 * 3`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@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")
```

## `input.int` (function, overload 2)

**Definition**

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`; each may be given by name, as in `input.int(14, "Length", minval=1, step=2)`.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.int(const int defval, const string title, [const int...] options, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input int
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const int` | yes | Default value of the input. The reader can change it from the chart. When `options` is given, `defval` must be one of its values. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `options` | `[const int...]` | no | List of values the reader can choose from. The value of `defval` must be one of them. | | |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input int`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.int()` cannot be `na`." Any constant expression of type int is accepted, such as `-5` or `2 * 3`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@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")
```

## `input.price` (function)

**Definition**

A price setting. The value comes back as a float.

Unlike `input.float` it takes no bounds and no step, so use `input.float` where a range matters.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.price(const float defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input float
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const float` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input float`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.price()` cannot be `na`." Any constant expression of type float is accepted, such as `100.5` or `2.5 * 2`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Custom Price Input", overlay=true)
priceLevel = input.price(22300.0, title="Custom Price Level", confirm=true)
plot(priceLevel, title="Selected Price", color=color.blue, linewidth=2, style=plotStyle.scatter)
```

## `input.session` (function)

**Definition**

Asks the reader for a session and gives you back a string.

The string is a session in the form that `time()` reads: `HHMM-HHMM` on a 24-hour clock, such as "0930-1600". Join ranges with commas, as in "1000-1100,1400-1500". Add `:` and the digits 1 to 7 to limit the session to days, Sunday being 1, as in "0930-1600:23456". A range that ends before it starts wraps past midnight, and "0000-0000" is the whole day.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.session(const string defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input string
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const string` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("input.session Example", overlay=true)
sess = input.session("0930-1600", "Trading Session")
inSession = not na(time(interval.interval, sess))
bgcolor(inSession ? color.new(color.blue, 0.1) : na)
```

## `input.source` (function)

**Definition**

Lets the reader pick which series the script reads — the close, the high, a midpoint, and so on.

It is the exception in this namespace: it returns a `series float` rather than an input-form value, so what you get back can differ on every bar.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.source(series float defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → series float
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `series float` | yes | Default source: a built-in series float variable such as `close` or `hlc3`. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`series float`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Custom Source Input", overlay=true)
src = input.source(close, title="Data Source")
smaValue = talib.sma(src, 14)
plot(smaValue, title="SMA", color=color.blue, linewidth=2)
```

## `input.string` (function)

**Definition**

A one-line text setting.

For a longer piece of text, reach for `input.text_area` instead; both return an `input string`.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.string(const string defval, const string title, [const string...] options, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input string
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const string` | yes | Default value of the input. The reader can change it from the chart. When `options` is given, `defval` must be one of its values. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `options` | `[const string...]` | no | List of values the reader can choose from. The value of `defval` must be one of them. | | |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input string`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.string()` cannot be `na`." Any constant expression of type string is accepted, such as `"a" + "b"`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("String Input Example", overlay=true)
customText = input.string("Bullish", title="Trend Direction")
bgcolor(customText == "Bullish" ? color.green : customText == "Bearish" ? color.red : na)
```

## `input.text_area` (function)

**Definition**

A multi-line text setting, for a message or a note rather than a single word.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.text_area(const string defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input string
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const string` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.none`: the value is shown only in the settings. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.none` |

**Returns**

`input string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Text Area Input Example", overlay=true)
customNotes = input.text_area("Enter your notes here...", title="Custom Notes")
bgcolor(customNotes == "Bullish" ? color.green : customNotes == "Bearish" ? color.red : na)
```

## `input.time` (function)

**Definition**

A time setting, returned as an int.

The date functions take a time and a timezone, so a value from here can be fed to `hour`, `year` and the rest.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.time(const int defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input int
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const int` | yes | The default time, in milliseconds since 1970-01-01 UTC, for example `1704067200000` for 2024-01-01 00:00 UTC. The reader can change it in the script's settings. Write the number itself: `timestamp(...)` compiles here but is worked out only when the script runs, so as a default it gives `na`. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader sets the time by clicking on the chart when the script is added to it, or afterwards by selecting the script and moving the selection. Optional. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.none`: the value is shown only in the settings. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.none` |

**Returns**

`input int`

**Notes**

* The default `defval` must be a value: `na` is rejected with "Argument `defval` of `input.time()` cannot be `na`." Any constant expression of type int that gives a time in milliseconds is accepted, such as `1700000000000` or `1000 * 60 * 60`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("input.time Example", overlay=true)
startTime = input.time(1767225600000, "Start Date")
// Highlight every bar from the chosen date onwards
bgcolor(time >= startTime ? color.new(color.green, 0.9) : na)
```

## `input.timeframe` (function)

**Definition**

Asks the reader for a timeframe. The answer arrives as a string.

Note what it is not: choosing a timeframe here does not fetch that timeframe's data. Lipi has no way to request another symbol's or another interval's series.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
input.timeframe(const string defval, const string title, const string tooltip, const string inline, const string group, const bool confirm, const display display) → input string
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `defval` | `const string` | yes | Default value of the input. The reader can change it from the chart. | | |
| `title` | `const string` | no | Title of the input. If not specified, the title is `Untitled`. If the title is specified but empty, the title is an empty string. | | `"Untitled"` |
| `tooltip` | `const string` | no | Text of a tooltip shown with the input. | | `""` |
| `inline` | `const string` | no | 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` | no | 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` | no | If true, the reader is asked to confirm the value before the script is added to the chart. The default is false. | | `false` |
| `display` | `const display` | no | Where the input's value is shown outside the script's settings, as a `display.*` constant: `display.status_line`, `display.data_window`, `display.all` or `display.none`. Combine constants with `+`. The default is `display.all`. | `display.none`, `display.data_window`, `display.status_line`, `display.all` | `display.all` |

**Returns**

`input string`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("input.timeframe Example", overlay=true)
tf = input.timeframe("1D", "Reference Timeframe")
// The input returns text only: compare it with the chart's own interval
sameAsChart = tf == interval.interval
bgcolor(sameAsChart ? color.new(color.green, 0.1) : na)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.