Adds a symbol setting to the script and returns the ticker text the user entered.
input.symbol returns a ticker string such as "NYSE:IBM", starting at defval. It is meant to be passed to request.security to read another instrument's data.
A symbol's text is only a name; nothing validates it until it is used. syminfo.tickerid is the usual default, which means the chart's own symbol.
Syntax
input.symbol(defval: const string, title: const string (optional), tooltip: const string (optional), inline: 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 ticker text, often syminfo.tickerid. |
| 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. |
| inline | const string | na | Entries sharing the same inline text sit on one row of 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 chosen ticker text.
Remarks
- On Sidechair: the setting is a text field with no symbol search.
- On Sidechair: confirm, display and active are accepted and ignored.
Example
//@version=6
indicator("Symbol input", overlay = true)
sym = input.symbol("", "Symbol")
other = request.security(sym == "" ? syminfo.tickerid : sym, timeframe.period, close)
plot(other, "Close", color = color.blue)See also
Runs on Sidechair