Sidechair

input.symbol()

Browse the reference

Adds a symbol setting to the script and returns the ticker text the user entered.

Try it in the editor

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

Pine Script
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 string

Arguments

NameTypeDefaultDescription
defvalconst stringrequiredDefault ticker text, often syminfo.tickerid.
titleconst stringnaName shown in the Settings dialog, the legend and the Data Window.
tooltipconst stringnaText shown in a tooltip beside the input in the Settings dialog.
inlineconst stringnaEntries sharing the same inline text sit on one row of the Settings dialog.
groupconst stringnaHeading the input is listed under in the Settings dialog.
confirmconst boolfalseWhen true, the script asks for this value when it is first added to the chart.
displayconst plot_displaydisplay.allWhere the value appears: a display.* constant or a combination of them.
activeinput booltrueWhen 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

Pine ScriptSymbol input defaulting to the chartOpen in editor
//@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