Adds a multi-line text setting to the script and returns its content as one string.
input.text_area returns the text the user typed into a larger box, line breaks included, starting at defval. It suits notes, lists of symbols and message templates.
Split the result on a separator with str.split to work with it line by line.
Syntax
input.text_area(defval: const string, title: const string (optional), tooltip: const string (optional), group: const string (optional), confirm: const bool (optional), display: const plot_display (optional), active: input bool (optional)) -> input stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| defval | const string | required | Default text. Line breaks are allowed. |
| title | const string | na | Name shown in the Settings dialog, the legend and the Data Window. |
| tooltip | const string | na | Text shown in a tooltip beside the input in the Settings dialog. |
| group | const string | na | Heading the input is listed under in the Settings dialog. |
| confirm | const bool | false | When true, the script asks for this value when it is first added to the chart. |
| display | const plot_display | display. | Where the value appears: a display.* constant or a combination of them. |
| active | input bool | true | When false, the input is greyed out and cannot be edited. |
Returns
input string: the entered text.
Remarks
- The inline argument does not exist here; the box always takes a full row.
- On Sidechair: confirm, display and active are accepted and ignored.
Example
//@version=6
indicator("Note", overlay = true)
note = input.text_area("Check earnings date", "Note")
if barstate.islast
label.new(bar_index, high, note, style = label.style_label_down, color = color.yellow)See also
Runs on Sidechair