# Symbology

The library requires information about the symbol to request and process data correctly. This information should be arranged in a specified format and supplied as a [`LibrarySymbolInfo`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md) object.
This article explains the most challenging concepts of the `LibrarySymbolInfo` implementation. You can find the complete list of interface parameters, and their descriptions, in the [API](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.LibrarySymbolInfo) section.

The library calls the [`resolveSymbol`](../api/interfaces/Charting_Library.IDatafeedChartApi.md#resolvesymbol) method to request symbol information. To provide this information, create the [`LibrarySymbolInfo`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md) object and pass it to [`ResolveCallback`](../api/modules/Datafeed.md#resolvecallback) as a parameter.

:::tip

Refer to the [Datafeed API](https://charting-library-docs.xstaging.tv/latest/connecting_data/datafeed-api.md) topic for more information on how to supply the chart with data.

:::

## Symbol name

The library addresses a symbol by a unique identifier. You can use [`ticker`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#ticker) or [`name`] to specify such an identifier for a certain symbol.

:::info

The ticker or name should not contain information other than an identifier for a symbol.
Therefore, they should not contain the exchange.

:::

### name

The `name` property is an identifier for a symbol within an exchange, such as `AAPL` or `9988` (on Hong Kong exchange).
This identifier is visible to users.
Note that the `name` value does not have to be unique and can be duplicated for several symbols.

By default, `name` is used to [resolve symbols](https://charting-library-docs.xstaging.tv/latest/connecting_data/datafeed-api/required-methods.md#resolvesymbol) in the [Datafeed API].
If you use [`ticker`](#ticker), the library will use the ticker for Datafeed API requests.

### ticker

If you need to address a symbol by a custom identifier (for example, numeric), you can use `ticker`.
It is not displayed to users.
You should avoid using colons (":") in ticker values unless you are following the TradingView format: "NYSE:IBM". Using colons may cause unexpected behavior and display bugs.

If you provide `ticker`, the library will use it for [Datafeed API] requests.
Make sure you provide `ticker` in [`LibrarySymbolInfo`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md) and [`SearchSymbolResultItem`](../api/interfaces/Charting_Library.SearchSymbolResultItem.md).

### Letter case

By default, all symbol names are shown in uppercase in the UI. To display lowercase symbol names, you should disable the [`uppercase_instrument_names`](../customization/Featuresets.md#uppercase_instrument_names) featureset and adjust symbol names in the [`resolveSymbol`](./datafeed-api/required-methods.md#resolvesymbol) and [`symbolSearch`](./datafeed-api/required-methods.md#searchsymbols) implementation.

Consider the following CodePen example:

See the Pen 
  How to display lowercase symbols by TradingView (@tradingview)
  on CodePen.

## Resolutions

Refer to the [Configure resolutions in datafeed](https://charting-library-docs.xstaging.tv/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions.md) article for information on how to specify the following properties:

- [`supported_resolutions`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#supported_resolutions)
- [`has_seconds`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#has_seconds)
- [`seconds_multipliers`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#seconds_multipliers)
- [`has_intraday`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#has_intraday)
- [`intraday_multipliers`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#intraday_multipliers)
- [`has_daily`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#has_daily)
- [`daily_multipliers`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#daily_multipliers)
- [`has_weekly_and_monthly`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#has_weekly_and_monthly)
- [`weekly_multipliers`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#weekly_multipliers)
- [`monthly_multipliers`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#monthly_multipliers)
- [`has_ticks`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#has_ticks)

## Time zone

The [`timezone`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#timezone) property should contain a time zone of the symbol's exchange.
For example, if the symbol's exchange is NASDAQ, the `timezone` value should be `"America/New_York"`.

The `timezone` value affects how the library arranges data on the chart. Make sure you specify this property correctly to avoid potential issues, such as [shifted bars](https://charting-library-docs.xstaging.tv/latest/connecting_data/Datafeed-Issues.md#library-shifts-bar-time). For more information about supported time zones, refer to the [Time zones](https://charting-library-docs.xstaging.tv/latest/ui_elements/timezones.md) article.

## Session

The [`session`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#session) property contains trading hours for the symbol. The time zone of the trading hours corresponds to the [`timezone`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#timezone) value.

The [`session`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#session) value affects how the library arranges data on the chart. Make sure you specify this property correctly to avoid potential issues, such as [shifted bars](https://charting-library-docs.xstaging.tv/latest/connecting_data/Datafeed-Issues.md#library-shifts-bar-time).
Refer to the [Trading Sessions](https://charting-library-docs.xstaging.tv/latest/connecting_data/time-and-sessions/Trading-Sessions.md) topic for more information on the session format.

### corrections

The [`corrections`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#corrections) property allows you to specify changes in a trading session for a specific day. For example, you can extend or shorten the session or reschedule it for another day. The `corrections` value overrides the default session specified in the [`session`](#session) property. You can specify corrections for days in the past and future.

The correction is a string that has the `SESSION:YYYYMMDD` format and consists of the following elements:

Element | Description | Example
---------|----------|---------
 SESSION | Trading hours specified in the same format as the `session` property. Refer to [Session formats](https://charting-library-docs.xstaging.tv/latest/connecting_data/time-and-sessions/Trading-Sessions.md#session-formats) for more information. | 1000&#8209;1400
 : | A separator between the session and the day when it is applied. | 
 YYYYMMDD | A day when the session is applied. | `20181114`

If the correction is applied to multiple days, you should list the days starting from the latest one and separate them by comma. For example, `"1000-1400:20180308,20180223,20180101"`.
To specify several corrections, list them one by one and use a semicolon as a separator, for example, `"1000-1845:20181113;1000-1400:20181114"`.

You can also specify corrections for holidays. Note that the `corrections` property has higher priority than [`session_holidays`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#session_holidays). Therefore, if both properties contain the same date, the library applies hours specified in `corrections` for that date.

## Extended sessions

The library allows you to display extended trading sessions for symbols that support them. To enable an extended session for a certain symbol, you should specify the properties below. For more information on how to handle the sessions, refer to the dedicated [Extended sessions](https://charting-library-docs.xstaging.tv/latest/connecting_data/time-and-sessions/Extended-Sessions.md) article.

:::caution

The `session`, `corrections`, `subsession_id`, and `subsessions` properties affect the [Market status pop-up](https://charting-library-docs.xstaging.tv/latest/ui_elements/market-status.md). Make sure you configure these properties to avoid an incorrect status for the symbol.

:::

### subsessions

An extended session includes regular, pre-market, and post-market subsessions. Either a pre-market or post-market subsession can be missed.
When the chart displays an extended session, the subsessions are represented as colored areas.

You should provide information on the extended session and its subsessions to the library using the [`subsessions`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#subsessions) property.
The property contains an array of [`LibrarySubsessionInfo`](../api/interfaces/Charting_Library.LibrarySubsessionInfo.md) objects, where each object describes a certain subsession.
For example, the code sample below specifies an extended session that starts at 04:00 and ends at 20:00. It includes a pre-market subsession from 04:00 to 09:30, a regular subsession from 09:30 to 16:00, and a post-market subsession from 16:00 to 20:00.

```javascript
"subsessions": [
    {
        "description": "Regular Trading Hours",
        "id": "regular",
        "session": "0930-1600"
    },
        {
        "description": "Extended Trading Hours",
        "id": "extended",
        "session": "0400-2000"
    },
    {
        "description": "Pre-market",
        "id": "premarket",
        "session": "0400-0930"
    },
    {
        "description": "Post-market",
        "id": "postmarket",
        "session": "1600-2000"
    }
]
```

### subsession_id

The [`subsession_id`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#subsession_id) property specifies the session type that the chart should currently display. The `subsession_id` value is either `"regular"` or `"extended"`. You should update the property's value when the session type is changed. Refer to the [Handle session switch](https://charting-library-docs.xstaging.tv/latest/connecting_data/time-and-sessions/Extended-Sessions.md#handle-session-switch) section for more information.

### Update session value

Note that the [`session`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#session) value depends on the chart type currently selected on the chart. The property's value should match the corresponding [`LibrarySubsessionInfo.session`](../api/interfaces/Charting_Library.LibrarySubsessionInfo.md#session) value specified in [`subsessions`](#subsessions). For example, if the chart displays `"extended"` session, and for this session type `LibrarySubsessionInfo.session` is `"0400-2000"`, the `LibrarySymbolInfo.session` value should also be `"0400-2000"`.
You should update `session` when the session type is changed. Refer to the [Handle session switch](https://charting-library-docs.xstaging.tv/latest/connecting_data/time-and-sessions/Extended-Sessions.md#handle-session-switch) section for more information.

:::tip

You can use the following expression to make sure that `session` is correct. The expression should always be `true`:

```javascript
symbolInfo.session === symbolInfo.subsessions.find(x => x.id === subsession_id).session
```

:::

## Supported price values

The [`visible_plots_set`] property indicates which values the symbol supports, such as open, high, low, close, and volume.
If you prefer to only provide close values, set `visible_plots_set` to `"c"`.
This makes the chart show the symbol data using only line-based styles.

## Price format

The library supports the [decimal](#decimal-format) and [fractional](#fractional-format) price formats. To configure how the price displays, specify the following properties:

- [`pricescale`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#pricescale) — a number of decimal places or fractions that the price has.
- [`minmov`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#minmov) — a number of units that represents the price tick.
- [`minmove2`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#minmove2) — a fraction of a fraction.
- [`fractional`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#fractional) — a boolean value that shows whether the format is fractional or decimal.

These properties' values depend on the chosen format and are not visible to users.

### Decimal format

- `pricescale` should be `10^n`, where `n` is the number of decimal places. For example, if the price is `1.01`, set `pricescale` to `100`.
- `minmov` depends on the tick size that is calculated as `minmov / pricescale`. For example, if the tick size is `0.25`, set `minmov` to `25`.
- `minmove2` should be `0` or not specified.
- `fractional` should be `false` or not specified.

Consider the following examples:

- The security's tick size is `0.01`. To display this security, set `minmov = 1`, `pricescale = 100`.
- The security's tick size is `0.0125`. To display this security, set `minmov = 125`, `pricescale = 10000`.
- The security's tick size is `0.20`. To display this security, set `minmov = 20`, `pricescale = 100`.

#### Variable tick size

If you need to adjust a tick size depending on a symbol price, you can additionally specify the [`variable_tick_size`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#variable_tick_size) property.
This property should be a `string` that contains prices and the corresponding tick sizes.
The library overrides the [`pricescale`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#pricescale)
and [`minmov`](../api/interfaces/Charting_Library.LibrarySymbolInfo.md#minmov) properties to represent the desired tick size.

For example, the `'0.01 10 0.02 25 0.05'` value specifies the following ticks:

- For prices less than or equal to 10, the tick size is `0.01`. Therefore, `minmov = 1`, `pricescale = 100`.
- For prices greater than 10 but less than or equal to 25, the tick size is `0.02`. Therefore, `minmov = 2`, `pricescale = 100`.
- For prices greater than 25, the tick size is `0.05`. Therefore, `minmov = 5`, `pricescale = 100`.

Note that you need to initialize `pricescale` and `minmov` regardless of whether you use `variable_tick_size` or not.

#### How to display pips

You can display pips for symbols that have `forex` or `cfd` type. To do this, set `minmove2` to `10`. In the UI, pips look smaller than the price digits.

![Symbology Pips Example](/img/symbology_pips.png)

If `minmove2` is `0` for `forex`/`cfd` symbols, the spread is displayed in ticks, not pips.

### Fractional format

The fractional price is displayed as `x'y` (for example, `133'21`), where `x` and `y` are the integer and fractional parts, respectively. A single quote is used as a delimiter.

- `pricescale` should be `2^n`. This value represents the number of fractions.
- `minmov` depends on the tick size that is calculated as `minmov / pricescale`. For example, if the tick size is `1/4`, set `minmov` to `1`.
- `minmove2` should be `0` or not specified.
- `fractional` should be `true`.

Consider the following examples:

- To display a security that has the `1/32` tick size, set  `minmov = 1`, `pricescale = 32`.
- To display a security that has the `2/8` tick size, set `minmov = 2`, `pricescale = 8`.

#### Fraction of a fraction format

The fraction of a fraction format is a particular case of the fractional format. It is displayed as `x'y'z` (for example, `133'21'5`), where `z` is a fractional part of `y`. In this case, `minmove2` differs from `0` and represents a fraction of a fraction. For example, the `ZBM2023` tick size is 1/4 of a 32nd. To display this security, set `minmov = 1`, `pricescale = 128`, `minmove2 = 4`. The price is displayed in the UI as follows:

- `119'16'0` represents `119 + 16.0/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`

[Datafeed API]: https://charting-library-docs.xstaging.tv/latest/connecting_data/datafeed-api.md
[`name`]: https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.LibrarySymbolInfo#name
[`visible_plots_set`]: https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.LibrarySymbolInfo#visible_plots_set

---

## Sitemap

- [All documentation pages](https://charting-library-docs.xstaging.tv/llms.txt)
- [Full page map with headings](https://charting-library-docs.xstaging.tv/docs_map.md)
