Returns the symbol name of a ticker id you pass, without its exchange prefix, so "NASDAQ:AAPL" gives AAPL.
syminfo.ticker(symbol) strips the prefix from any ticker id. It is the function form of the syminfo.ticker variable, which answers for the current symbol only.
Use it to show a clean name for a symbol taken from input.symbol, or to compare a requested symbol against a typed name.
Syntax
syminfo.ticker(symbol: simple string) -> simple string
syminfo.ticker(symbol: series string) -> series stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| symbol | simple/ | required | A ticker id, usually with a prefix before a colon, such as "NASDAQ:AAPL" or syminfo.tickerid. |
Returns
simple/series string: The text after the colon of the ticker id.
Remarks
- Pass a series string when the id changes bar to bar; the result is then a series string.
- On Sidechair: not supported yet; the call warns that
syminfo.ticker()isn't supported yet and returns na, and the rest of the script keeps running. Use thesyminfo.tickervariable for the chart's own symbol.
Example
//@version=6
indicator("Name of an id", overlay = true)
name = syminfo.ticker(syminfo.tickerid)
plot(close, "Close", color.gray)
if barstate.islast
label.new(bar_index, high, na(name) ? syminfo.ticker : name)See also
Not on Sidechair yet