The ticker id of the chart's own symbol, unchanged even when read inside a request.security expression.
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.securityit equalssyminfo.tickerid. - On Sidechair: not supported yet; a script that reads
syminfo.main_tickeridstops with the error "syminfo.main_tickerid" isn't supported yet.request.securityis not run yet either, so usesyminfo.tickerid.
Example
//@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