The kind of instrument on the chart, as a string such as stock, futures, forex, crypto or index.
syminfo.type is a simple string naming the symbol's class. Standard values include stock, fund, dr, right, bond, warrant, structured, index, forex, futures, spread, economic, fundamental, crypto and cfd.
Use it to switch a script's behavior by market: a different session assumption for futures, a quote-currency note for forex, a skip for indices that carry no volume.
Type
simple string
Remarks
- Compare against the exact lowercase strings. A typo does not error; the test is just always false.
- On Sidechair: the value is one of stock, futures, forex, index or crypto.
Example
//@version=6
indicator("Volume or not", format = format.volume)
noVolume = syminfo.type == "index" or syminfo.type == "forex"
plot(noVolume ? na : volume, "Volume", color.teal, style = plot.style_columns)
if barstate.islast
label.new(bar_index, 0, "type: " + syminfo.type)See also
Runs on Sidechair