syminfo

The syminfo namespace provides information about the current trading symbol, including its name, exchange prefix, currency, trading characteristics, and analyst price targets.

Quick Example

from pynecore.lib import (
    syminfo, bar_index, label, close, script, time, string
)

@script.indicator(title="Symbol Info Display", overlay=True)
def main():
    # syminfo.tickerid and syminfo.ticker both contain "PREFIX:SYMBOL"
    full_id: str = syminfo.tickerid  # "NASDAQ:AAPL"
    currency: str = syminfo.currency or "NA"
    market_type: str = syminfo.type or "NA"
    
    # Display symbol details at first bar
    if bar_index == 0:
        info_text: str = f"{full_id} | {market_type} | {currency}"
        label.new(bar_index, close, info_text)

Variables

Basic Symbol Information

prefix

Type: str | NA[str]

The exchange prefix of the symbol. For example, “NASDAQ” for “NASDAQ:AAPL” or “BINANCE” for “BINANCE:BTCUSDT”.

exch: str | NA[str] = syminfo.prefix  # "NASDAQ"

ticker

Type: str | NA[str]

The full symbol identifier including the exchange prefix, in "PREFIX:SYMBOL" format. For example, "NASDAQ:AAPL" or "BINANCE:BTCUSDT". In PyneCore, ticker and tickerid return the same value.

sym: str | NA[str] = syminfo.ticker  # "NASDAQ:AAPL"

tickerid

Type: str | NA[str]

The full symbol identifier including the exchange prefix, in "PREFIX:SYMBOL" format. Same value as ticker. This is the form used as the first argument to request.security().

full_id: str | NA[str] = syminfo.tickerid  # "NASDAQ:AAPL"

root

Type: str | NA[str]

The symbol name without the exchange prefix. For example, "AAPL" for "NASDAQ:AAPL". For derivatives, this is the root contract name (e.g., "ES" for E-mini S&P 500 futures).

root_name: str | NA[str] = syminfo.root  # "AAPL"

Currency and Location

currency

Type: str | NA[str]

The currency code of the symbol’s prices. For example, “USD” for “NASDAQ:AAPL” or “USDT” for “BINANCE:BTCUSDT”.

ccy: str | NA[str] = syminfo.currency  # "USD"

basecurrency

Type: str | NA[str]

The base currency code for Forex or cryptocurrency pairs. For example, “EUR” for “FX:EURUSD” or “BTC” for “BINANCE:BTCUSDT”.

base: str | NA[str] = syminfo.basecurrency  # "EUR" or "BTC"

Always use the bare base asset code"BTC" for BTCUSDT, BTCUSDT.P, BINANCE:BTCUSDT, BYBIT:BTCUSDT.P alike; never the full pair or ticker string ("BTCUSDT", "BTC.P", "BINANCEBTC.P"). PyneCore uses exact-match comparisons against this field internally. The most visible consequence is order-quantity rounding for crypto: "BTC" selects 6-decimal qty precision (matching TradingView), anything else falls back to 4 decimals. With default_qty_type = strategy.percent_of_equity on a high-priced BTC instrument this manifests as a small (~0.1–0.9%) per-trade undersize that compounds into multi-percent equity drift over hundreds of trades.

country

Type: str | NA[str]

The two-letter country code (ISO 3166-1 alpha-2 format) where the symbol is traded, or na if not available.

nation: str | NA[str] = syminfo.country  # "US", "GB", etc.

timezone

Type: str | NA[str]

The timezone of the exchange where the symbol is traded. Uses IANA timezone identifiers (e.g., “America/New_York”, “Europe/London”).

tz: str | NA[str] = syminfo.timezone  # "America/New_York"

Market Characteristics

type

Type: Literal['stock', 'future', 'option', 'forex', 'index', 'fund', 'bond', 'crypto'] | NA[str]

The market type of the symbol. Possible values include “stock”, “future”, “option”, “forex”, “index”, “fund”, “bond”, or “crypto”.

market: str = syminfo.type  # "stock", "future", etc.

session

Type: Session

The session type of the chart’s main series. Possible values are session.regular or session.extended.

sess: Session = syminfo.session  # session.regular

volumetype

Type: Literal["base", "quote", "tick", "n/a"] | NA[str]

The volume type of the symbol. Possible values are “base” (base currency), “quote” (quote currency), “tick” (number of transactions), or “n/a” if not applicable.

vol_type: str = syminfo.volumetype  # "base", "quote", etc.

Price Scaling

mintick

Type: float | NA[float]

The minimum tick value for the symbol — the smallest increment between price movements. For stocks, typically 0.01; for forex, often 0.0001.

tick: float | NA[float] = syminfo.mintick  # 0.01

pricescale

Type: int | NA[int]

The denominator used to calculate the minimum tick. The minimum tick is calculated as minmove / pricescale.

scale: int | NA[int] = syminfo.pricescale  # 100

minmove

Type: int

The numerator used to calculate the minimum tick. The minimum tick is calculated as minmove / pricescale. Default value is 1.

move: int = syminfo.minmove  # 1

pointvalue

Type: float | NA[float]

The point value of the symbol — the currency amount per “point” of price movement. For stocks, typically 1.0; for futures, varies by contract.

pv: float | NA[float] = syminfo.pointvalue  # 1.0

Classification

description

Type: str | NA[str]

A descriptive text for the symbol provided by the exchange or data source.

desc: str | NA[str] = syminfo.description  # "Apple Inc."

sector

Type: str | NA[str]

The sector classification for stocks, or na if not available. Examples: “Electronic Technology”, “Technology Services”, “Energy Minerals”.

sec: str | NA[str] = syminfo.sector  # "Electronic Technology"

industry

Type: str | NA[str]

The industry classification for stocks, or na if not available. Examples: “Internet Software/Services”, “Integrated Oil”, “Packaged Software”.

ind: str | NA[str] = syminfo.industry  # "Internet Software/Services"

period

Type: str | NA[str]

The period or resolution of the chart data. Examples: “1”, “60” for minute bars; “D” for daily; “W” for weekly; “M” for monthly.

p: str | NA[str] = syminfo.period  # "60", "D", "W"

Analyst Price Targets

target_price_average

Type: float | NA[float]

The average price target for the symbol predicted by analysts.

avg_target: float | NA[float] = syminfo.target_price_average  # 150.0

target_price_high

Type: float | NA[float]

The highest price target for the symbol predicted by analysts.

high_target: float | NA[float] = syminfo.target_price_high  # 175.0

target_price_low

Type: float | NA[float]

The lowest price target for the symbol predicted by analysts.

low_target: float | NA[float] = syminfo.target_price_low  # 125.0

target_price_date

Type: int | NA[int]

A UNIX timestamp representing the date of the last analyst price target prediction for the symbol.

target_date: int | NA[int] = syminfo.target_price_date  # 1704067200

Compatibility Notes

The following syminfo fields are not available in PyneCore:

  • current_contract: The ticker identifier of the underlying contract for continuous futures
  • employees: Number of employees
  • expiration_date: UNIX timestamp for the last trading day of a futures contract
  • main_tickerid: Alternate full identifier for the chart symbol
  • mincontract: Smallest amount of the symbol that can be traded
  • recommendations_buy, recommendations_buy_strong, recommendations_hold, recommendations_sell, recommendations_sell_strong: Analyst recommendation counts by rating
  • recommendations_total, recommendations_date: Total recommendation count and recommendation date
  • shareholders: Number of shareholders
  • shares_outstanding_float, shares_outstanding_total: Outstanding share counts
  • target_price_estimates, target_price_median: Median price target and estimate count

These fields depend on fundamental and analyst data that is not available in historical OHLCV data sources used by PyneCore.