Skip to main content
Version: latest

LibrarySymbolInfo

Interface

Properties

base_name

Optional

Array of base symbols Example: for AAPL*MSFT it is ['NASDAQ:AAPL', 'NASDAQ:MSFT']

Type

[string]


corrections

Optional

List of corrections for a symbol. The corrections are days when the trading session differs from the default one set in LibrarySymbolInfo.session. The corrections value is a string in the following format: SESSION:YYYYMMDD. For more information, refer to corrections.

The string below specifies corrections for two trading days:

  • November 13, 2018. This trading day is split into two sessions. The first session starts at 19:00 four days before (November 9, 2018) and ends at 23:50 four days before. The second session starts at 10:00 and ends at 18:45.
  • November 14, 2018. The session starts at 10:00 and ends at 14:00.

Example

"1900F4-2350F4,1000-1845:20181113;1000-1400:20181114"

Type

string


currency_code

Optional

The currency in which the instrument is traded or some other currency if currency conversion is enabled. It is displayed in the Symbol Info dialog and on the price axes.

Type

string


daily_multipliers

Optional

Array (of strings) containing the resolutions (in days - without the suffix) supported by the datafeed. ResolutionString

For example it could be something like

daily_multipliers = ['1', '3', '4', '6', '7'];

Default

['1']

Type

string[]


data_status

Optional

The status code of a series with this symbol. For delayed_streaming and endofday type of data, the status is displayed as an icon and the Data is delayed section in the Legend, next to the market status icon. Note that you should also enable the display_data_mode featureset.

When declaring delayed_streaming you also have to specify its LibrarySymbolInfo.delay in seconds.

Type

"streaming" | "endofday" | "delayed_streaming"


delay

Optional

Type of delay that is associated to the data or real delay for real time data.

  • 0 for realtime
  • -1 for endofday
  • or delay in seconds (for delayed realtime)

Type

number


description

The description of the symbol. Will be displayed in the chart legend for this symbol.

Type

string


exchange

Traded exchange (current (proxy) exchange). The name will be displayed in the chart legend for this symbol.

Example

"NYSE"

Type

string


Optional

URL of image to be displayed as the logo for the exchange. The show_exchange_logos featureset needs to be enabled for this to be visible in the UI.

The image should ideally be square in dimension. You can use any image type which the browser supports natively. Simple SVG images are recommended.

Examples:

  • https://yourserver.com/exchangeLogo.svg
  • /images/myImage.png
  • data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...
  • data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...

Type

string


expiration_date

Optional

Unix timestamp of the expiration date. One must set this value when expired = true. The library will request data for this symbol starting from that time point.

Type

number


expired

Optional

Boolean showing whether this symbol is expired futures contract or not.

Default

false

Type

boolean


format

Format of displaying labels on the price scale:

price - formats decimal or fractional numbers based on minmov, pricescale, minmove2, fractional and variableMinTick values. See Price Formatting for more details volume - formats decimal numbers in thousands, millions, billions or trillions

Type

SeriesFormat


fractional

Optional

For common prices this can be skipped.

Fractional prices are displayed 2 different forms: 1) xx'yy (for example, 133'21) 2) xx'yy'zz (for example, 133'21'5).

  • xx is an integer part.
  • minmov/pricescale is a Fraction.
  • minmove2 is used in form 2.
  • fractional is true.
  • variableMinTick is skipped.

Example:

If minmov = 1, pricescale = 128 and minmove2 = 4:

  • 119'16'0 represents 119 + 16/32
  • 119'16'2 represents 119 + 16.25/32
  • 119'16'5 represents 119 + 16.5/32
  • 119'16'7 represents 119 + 16.75/32

More examples:

  • ZBM2014 (T-Bond) with 1/32: minmov = 1, pricescale = 32, minmove2 = 0
  • ZCM2014 (Corn) with 2/8: minmov = 2, pricescale = 8, minmove2 = 0
  • ZFM2014 (5 year t-note) with 1/4 of 1/32: minmov = 1, pricescale = 128, minmove2 = 4

Type

boolean


has_daily

Optional

The boolean value specifying whether the datafeed can supply historical data at the daily resolution.

If has_daily is set to false, all buttons for resolutions that include days are disabled for this particular symbol. Otherwise, the library requests daily bars from the datafeed. All daily resolutions that the datafeed supplies must be included in the LibrarySymbolInfo.daily_multipliers array.

Default

true

Type

boolean


has_empty_bars

Optional

The boolean value showing whether the library should generate empty bars in the session when there is no data from the data feed for this particular time.

I.e., if your session is 0900-1600 and your data has gaps between 11:00 and 12:00 and your has_empty_bars is true, then the Library will fill the gaps with bars for this time.

Flag has_empty_bars = true cannot be used if featureset disable_resolution_rebuild is enabled.

Default

false

Type

boolean


has_intraday

Optional

Boolean value showing whether the symbol includes intraday (minutes) historical data.

If it's false then all buttons for intraday resolutions will be disabled for this particular symbol. If it is set to true, all intradays resolutions that are supplied directly by the datafeed must be provided in intraday_multipliers array.

WARNING Any daily, weekly or monthly resolutions cannot be inferred from intraday resolutions.

false if DWM only

Default

false

Type

boolean


has_seconds

Optional

Boolean value showing whether the symbol includes seconds in the historical data.

If it's false then all buttons for resolutions that include seconds will be disabled for this particular symbol.

If it is set to true, all resolutions that are supplied directly by the data feed must be provided in seconds_multipliers array.

Default

false

Type

boolean


has_ticks

Optional

Boolean value showing whether the symbol includes ticks in the historical data.

If it's false then all buttons for resolutions that include ticks will be disabled for this particular symbol.

Default

false

Type

boolean


has_weekly_and_monthly

Optional

The boolean value showing whether data feed has its own weekly and monthly resolution bars or not.

If has_weekly_and_monthly = false then the library will build the respective resolutions using daily bars by itself. If not, then it will request those bars from the data feed using either the weekly_multipliers or monthly_multipliers if specified. If resolution is not within either list an error will be raised.

Default

false

Type

boolean


industry

Optional

Industry for stocks to be displayed in the Symbol Info.

Type

string


intraday_multipliers

Optional

Array of resolutions (in minutes) supported directly by the data feed. Each such resolution may be passed to, and should be implemented by, getBars. The default of [] means that the data feed supports aggregating by any number of minutes.

If the data feed only supports certain minute resolutions but not the requested resolution, getBars will be called (repeatedly if needed) with a higher resolution as a parameter, in order to build the requested resolution.

For example, if the data feed only supports minute resolution, set intraday_multipliers to ['1'].

When the user wants to see 5-minute data, getBars will be called with the resolution set to 1 until the library builds all the 5-minute resolution by itself.

Example

(for ex.: "1,5,60") - only these resolutions will be requested, all others will be built using them if possible

Default

[]

Type

string[]


listed_exchange

short name of the exchange where this symbol is traded (real listed exchange). The name will be displayed in the chart legend for this symbol.

Example

"NYSE"

Type

string


logo_urls

Optional

URL of image/s to be displayed as the logo/s for the symbol. The show_symbol_logos featureset needs to be enabled for this to be visible in the UI.

  • If a single url is returned then that url will solely be used to display the symbol logo.
  • If two urls are provided then the images will be displayed as two partially overlapping circles with the first url appearing on top. This is typically used for FOREX where you would like to display two country flags are the symbol logo.

The image/s should ideally be square in dimension. You can use any image type which the browser supports natively.

Examples:

  • https://yourserver.com/apple.svg
  • /images/myImage.png
  • data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...
  • data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...

Type

[string, string] | [string]


long_description

Optional

Symbol Long description

Optional long(er) description for the symbol.

Type

string


minmov

The number of units that make up one tick.

Example

For example, U.S. equities are quotes in decimals, and tick in decimals, and can go up +/- .01. So the tick increment is 1. But the e-mini S&P futures contract, though quoted in decimals, goes up in .25 increments, so the tick increment is 25. (see also Tick Size)

Type

number


minmove2

Optional

For common prices this can be skipped.

Example

Quarters of 1/32: pricescale=128, minmovement=1, minmovement2=4

Type

number


monthly_multipliers

Optional

Array (of strings) containing the resolutions (in months - without the suffix) supported by the data feed. ResolutionString

For example it could be something like

monthly_multipliers = ['1', '3', '4', '12'];

Default

['1']

Type

string[]


name

It is a symbol name within an exchange, such as AAPL or 9988 (Hong Kong). Note that it should not contain the exchange name. This symbol name is visible to users and can be repeated.

By default, name is used to resolve symbols in the Datafeed API. If you use LibrarySymbolInfo.ticker, the library will use the ticker for Datafeed API requests.

Type

string


original_currency_code

Optional

The currency in which the instrument is traded.

Type

string


original_unit_id

Optional

A unique identifier of a unit in which the instrument is traded.

Type

string


price_source_id

Optional

Optional ID of a price source for a symbol. Should match one of the price sources from the price_sources array.

Note that you should set the symbol_info_price_source featureset to true to display the symbol price source in the main series legend.

Type

string


price_sources

Optional

Supported price sources for the symbol. Price sources appear in the series legend and indicate the origin of values represented by symbol bars. Example price sources: "Spot Price", "Ask", "Bid", etc. The price source information is valuable when viewing non-OHLC series types.

Note that you should set the symbol_info_price_source featureset to true to display the symbol price source in the main series legend.

Example

[{ id: '1', name: 'Spot Price' }, { id: '321', name: 'Bid' }]

Type

SymbolInfoPriceSource[]


pricescale

Code (Tick)

Example

8/16/.../256 (1/8/100 1/16/100 ... 1/256/100) or 1/10/.../10000000 (1 0.1 ... 0.0000001)

Type

number


seconds_multipliers

Optional

It is an array containing resolutions that include seconds (excluding postfix) that the data feed provides. E.g., if the data feed supports resolutions such as ["1S", "5S", "15S"], but has 1-second bars for some symbols then you should set seconds_multipliers of this symbol to [1]. This will make the library build 5S and 15S resolutions by itself.

Type

string[]


sector

Optional

Sector for stocks to be displayed in the Symbol Info.

Type

string


session

Trading hours for this symbol. See the Trading sessions article to learn more details.

Example

"1700-0200"

Type

string


session_display

Optional

The session value to display in the UI. If not specified, then session is used.

Type

string


session_holidays

Optional

A string that contains a list of non-trading holidays for the symbol. Holiday dates should be in the YYYYMMDD format. These dates are not displayed on the chart.

You can specify a correction for a holiday using LibrarySymbolInfo.corrections.

Example

"20181105,20181107,20181112"

Type

string


subsession_id

Optional

An ID of a subsession specified in subsessions. The value must match the subsession that is currently displayed on the chart. For more information, refer to the Extended sessions section.

Type

string


subsessions

Optional

An array of objects that contain information about certain subsessions within the extended session. For more information, refer to the Extended sessions section.

Type

LibrarySubsessionInfo[]


supported_resolutions

Optional

An array of resolutions which should be enabled in the Resolution drop-down menu for this symbol. Each item of the array is expected to be a string that has a specific format.

If one changes the symbol and the new symbol does not support the selected resolution, the resolution will be switched to the first available one in the list.

Resolution availability logic (pseudocode):

resolutionAvailable  =
resolution.isIntraday
? symbol.has_intraday && symbol.supported_resolutions(resolution)
: symbol.supported_resolutions(resolution);

If supported_resolutions is [] (empty array), all resolutions are disabled in the Resolution drop-down menu.

If supported_resolutions is undefined, all resolutions that the chart support (DatafeedConfiguration.supported_resolutions) and custom resolutions are enabled.

Note that the list of available time frames depends on supported resolutions. Time frames that require resolutions that are unavailable for a particular symbol will be hidden. Refer to Time frame toolbar for more information.

Type

ResolutionString[]


ticker

Optional

It is an unique identifier for a particular symbol in your symbology. If you specify this property, its value will be used for all data requests for this symbol. ticker will be treated the same as LibrarySymbolInfo.name if not specified explicitly. Note that it should not contain the exchange name.

Type

string


timezone

Time zone of the exchange for this symbol. We expect to get the name of the time zone in olsondb format. See Time zones for a full list of supported time zones.

Type

Timezone


type

Type of the instrument. Possible values: SymbolType

Type

string


unit_conversion_types

Optional

Allowed unit conversion group names.

Type

string[]


unit_id

Optional

A unique identifier of a unit in which the instrument is traded or some other identifier if unit conversion is enabled. It is displayed on the price axes.

Type

string


variable_tick_size

Optional

Dynamic minimum price movement. It is used if the instrument's minimum price movement changes depending on the price range.

For example, '0.01 10 0.02 25 0.05', where the tick size is 0.01 for a price less than 10, the tick size is 0.02 for a price less than 25, the tick size is 0.05 for a price greater than or equal to 25.

Type

string


visible_plots_set

Optional

Represents what values are supported by the symbol. Possible values:

  • ohlcv - the symbol supports open, high, low, close and has volume
  • ohlc - the symbol supports open, high, low, close, but doesn't have volume
  • c - the symbol supports only close, it's displayed on the chart using line-based styles only

Default

'ohlcv'

Type

VisiblePlotsSet


volume_precision

Optional

Integer showing typical volume value decimal places for a particular symbol. 0 means volume is always an integer. 1 means that there might be 1 numeric character after the comma.

Default

'0'

Type

number


weekly_multipliers

Optional

Array (of strings) containing the resolutions (in weeks - without the suffix) supported by the data feed. ResolutionString

For example it could be something like

weekly_multipliers = ['1', '5', '10'];

Default

['1']

Type

string[]