syminfo - Pine Script Variable
syminfo
Section titled “syminfo”Overview
Section titled “Overview”Symbol metadata such as exchange, session, ticker, and currency.
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
syminfo.basecurrency | simple string | Returns a string containing the code representing the symbol’s base currency (i.e., the traded currency or coin) if the instrument is a Forex or Crypto pair or a derivative based on such a pair. Otherwise, it returns an empty string. For example, this variable returns “EUR” for “EURJPY”, “BTC” for “BTCUSDT”, “CAD” for “CME:6C1!”, and "" for “NASDAQ:AAPL”. |
syminfo.country | simple string | Returns the two-letter code of the country where the symbol is traded (ISO 3166-1 alpha-2), or na if the exchange is not directly tied to a specific country. For example, on “NASDAQ:AAPL” it will return “US”, on “LSE:AAPL” it will return “GB”, and on “BITSTAMP:BTCUSD” it will return na. |
syminfo.currency | simple string | Returns a string containing the code representing the currency of the symbol’s prices. For example, this variable returns “USD” for “NASDAQ:AAPL” and “JPY” for “EURJPY”. |
syminfo.current_contract | simple string | The ticker identifier of the underlying contract, if the current symbol is a continuous futures contract; na otherwise. |
syminfo.description | simple string | Description for the current symbol. |
syminfo.employees | simple int | The number of employees the company has. |
syminfo.expiration_date | simple int | A UNIX timestamp representing the start of the last day of the current futures contract. This variable is only compatible with non-continuous futures symbols. On other symbols, it returns na. |
syminfo.industry | simple string | Returns the industry of the symbol, or na if the symbol has no industry. Example: “Internet Software/Services”, “Packaged software”, “Integrated Oil”, “Motor Vehicles”, etc. These are the same values one can see in the chart’s “Symbol info” window. |
syminfo.main_tickerid | simple string | A ticker identifier representing the current chart’s symbol. The value contains an exchange prefix and a symbol name, separated by a colon (e.g., “NASDAQ:AAPL”). It can also include information about data modifications such as dividend adjustment, non-standard chart type, currency conversion, etc. Unlike syminfo.tickerid, this variable’s value does not change when used in the expression argument of a request.*() function call. |
syminfo.mincontract | simple float | The smallest amount of the current symbol that can be traded. This limit is set by the exchange. For cryptocurrencies, it is often less than 1 token. For most other types of asset, it is often 1. |
syminfo.minmove | simple int | Returns a whole number used to calculate the smallest increment between a symbol’s price movements (syminfo.mintick). It is the numerator in the syminfo.mintick formula: syminfo.minmove / syminfo.pricescale = syminfo.mintick. |
syminfo.mintick | simple float | Min tick value for the current symbol. |
syminfo.pointvalue | simple float | The chart price of a security multiplied by the point value equals the actual price of the traded security. |
syminfo.prefix | simple string | Prefix of current symbol name (i.e. for ‘CME_EOD:TICKER’ prefix is ‘CME_EOD’). |
syminfo.pricescale | simple int | Returns a whole number used to calculate the smallest increment between a symbol’s price movements (syminfo.mintick). It is the denominator in the syminfo.mintick formula: syminfo.minmove / syminfo.pricescale = syminfo.mintick. |
syminfo.recommendations_buy | series int | The number of analysts who gave the current symbol a “Buy” rating. |
syminfo.recommendations_buy_strong | series int | The number of analysts who gave the current symbol a “Strong Buy” rating. |
syminfo.recommendations_date | series int | The starting date of the last set of recommendations for the current symbol. |
syminfo.recommendations_hold | series int | The number of analysts who gave the current symbol a “Hold” rating. |
syminfo.recommendations_sell | series int | The number of analysts who gave the current symbol a “Sell” rating. |
syminfo.recommendations_sell_strong | series int | The number of analysts who gave the current symbol a “Strong Sell” rating. |
syminfo.recommendations_total | series int | The total number of recommendations for the current symbol. |
syminfo.root | simple string | Root for derivatives like futures contract. For other symbols returns the same value as syminfo.ticker. |
syminfo.sector | simple string | Returns the sector of the symbol, or na if the symbol has no sector. Example: “Electronic Technology”, “Technology services”, “Energy Minerals”, “Consumer Durables”, etc. These are the same values one can see in the chart’s “Symbol info” window. |
syminfo.session | simple string | Session type of the chart main series. Possible values are session.regular, session.extended. |
syminfo.shareholders | simple int | The number of shareholders the company has. |
syminfo.shares_outstanding_float | simple float | The total number of shares outstanding a company has available, excluding any of its restricted shares. |
syminfo.shares_outstanding_total | simple int | The total number of shares outstanding a company has available, including restricted shares held by insiders, major shareholders, and employees. |
syminfo.target_price_average | series float | The average of the last yearly price targets for the symbol predicted by analysts. |
syminfo.target_price_date | series int | The starting date of the last price target prediction for the current symbol. |
syminfo.target_price_estimates | series float | The latest total number of price target predictions for the current symbol. |
syminfo.target_price_high | series float | The last highest yearly price target for the symbol predicted by analysts. |
syminfo.target_price_low | series float | The last lowest yearly price target for the symbol predicted by analysts. |
syminfo.target_price_median | series float | The median of the last yearly price targets for the symbol predicted by analysts. |
syminfo.ticker | simple string | Symbol name without exchange prefix, e.g. ‘MSFT’. |
syminfo.tickerid | simple string | A ticker identifier representing the chart’s symbol or a requested symbol, depending on how the script uses it. The variable’s value represents a requested dataset’s ticker ID when used in the expression argument of a request.*() function call. Otherwise, it represents the chart’s ticker ID. The value contains an exchange prefix and a symbol name, separated by a colon (e.g., “NASDAQ:AAPL”). It can also include information about data modifications such as dividend adjustment, non-standard chart type, currency conversion, etc. |
syminfo.timezone | simple string | Timezone of the exchange of the chart main series. Possible values see in timestamp. |
syminfo.type | simple string | The type of market the symbol belongs to. The values are “stock”, “fund”, “dr”, “right”, “bond”, “warrant”, “structured”, “index”, “forex”, “futures”, “spread”, “economic”, “fundamental”, “crypto”, “spot”, “swap”, “option”, “commodity”. |
syminfo.volumetype | simple string | Volume type of the current symbol. Possible values are: “base” for base currency, “quote” for quote currency, “tick” for the number of transactions, and “n/a” when there is no volume or its type is not specified. |
Remarks
Section titled “Remarks”- Some fields may return empty strings or
nadepending on the asset class and exchange. syminfo.industry: A sector is a broad section of the economy. An industry is a narrower classification. NASDAQ:CAT (Caterpillar, Inc.) for example, belongs to the “Producer Manufacturing” sector and the “Trucks/Construction/Farm Machinery” industry.syminfo.sector: A sector is a broad section of the economy. An industry is a narrower classification. NASDAQ:CAT (Caterpillar, Inc.) for example, belongs to the “Producer Manufacturing” sector and the “Trucks/Construction/Farm Machinery” industry.syminfo.target_price_average: If analysts supply the targets when the market is closed, the variable can return na until the market opens.syminfo.target_price_date: If analysts supply the targets when the market is closed, the variable can return na until the market opens.syminfo.target_price_estimates: If analysts supply the targets when the market is closed, the variable can return na until the market opens.syminfo.target_price_high: If analysts supply the targets when the market is closed, the variable can return na until the market opens.syminfo.target_price_low: If analysts supply the targets when the market is closed, the variable can return na until the market opens.syminfo.target_price_median: If analysts supply the targets when the market is closed, the variable can return na until the market opens.syminfo.tickerid: Because the value of this variable does not always use a simple “prefix:ticker” format, it is a poor candidate for use in boolean comparisons or string manipulation functions. In those contexts, run the variable’s result through ticker.standard to purify it. This will remove any extraneous information and return a ticker ID consistently formatted using the “prefix:ticker” structure.syminfo.volumetype: Only some data feed suppliers provide information qualifying volume. As a result, the variable will return a value on some symbols only, mostly in the crypto sector.
Example
Section titled “Example”//@version=6indicator("Symbol info", overlay=true, max_labels_count=1)
if barstate.islast label.new(bar_index, high, text=str.format("{0}\n{1}\n{2}", syminfo.tickerid, syminfo.type, syminfo.currency), style=label.style_label_left)