Sidechair

syminfo.main_tickerid

Browse the reference

The ticker id of the chart's own symbol, unchanged even when read inside a request.security expression.

Try it in the editor

syminfo.main_tickerid is a simple string. Inside request.security, the other syminfo variables describe the requested symbol, so syminfo.tickerid there names the other symbol. This variable still names the symbol the chart is showing.

Use it when an expression running in another symbol's context needs to refer back to the chart's own instrument, for example to avoid requesting the same symbol twice.

Type

simple string

Remarks

  • Outside request.security it equals syminfo.tickerid.
  • On Sidechair: not supported yet; a script that reads syminfo.main_tickerid stops with the error "syminfo.main_tickerid" isn't supported yet. request.security is not run yet either, so use syminfo.tickerid.

Example

Pine ScriptSkip the redundant requestOpen in editor
//@version=6
indicator("Benchmark", overlay = true)
bench = input.symbol("SPY", "Benchmark")
same = bench == syminfo.main_tickerid
other = same ? close : request.security(bench, timeframe.period, close)
plot(other, "Benchmark close", color.orange)

See also

Not on Sidechair yet