Skip to main content

DatafeedConfiguration

Interface
Types Module: Datafeed

Datafeed configuration data. Pass the resulting array of properties as a parameter to OnReadyCallback of the onReady method.

Properties

currency_codes

Optional

Supported currencies for currency conversion.

When a currency code is supplied as a string then the library will automatically convert it to { id: value, code: value } object.

Example

`["USD", "EUR", "GBP"]`

Example

`[{ id: "USD", code: "USD", description: "$" }, { id: "EUR", code: "EUR", description: "€" }]`

Type

(string | CurrencyItem)[]


exchanges

Optional

List of exchange descriptors. An empty array leads to an absence of the exchanges filter in the Symbol Search list. Use value='' if you wish to include all exchanges.

Type

Exchange[]


supported_resolutions

Optional

List of resolutions that the chart should support. Each item of the array is expected to be a string that has a specific format. If you set this property to undefined or an empty array, the Resolution drop-down menu displays the list of resolutions available for the current symbol (LibrarySymbolInfo.supported_resolutions).

Example

`["1", "15", "240", "D", "6M"]` will give you "1 minute, 15 minutes, 4 hours, 1 day, 6 months" in the _Resolution_ drop-down menu.

Type

ResolutionString[]


supports_marks

Optional

Does the datafeed supports marks on bars (true), or not (false | undefined).

Type

boolean


supports_time

Optional

Set this one to true if your datafeed provides server time (unix time). It is used to adjust Countdown on the Price scale.

Type

boolean


supports_timescale_marks

Optional

Does the datafeed supports marks on the timescale (true), or not (false | undefined).

Type

boolean


symbols_grouping

Optional

Set it if you want to group symbols in the Symbol Search. Represents an object where keys are symbol types SymbolType and values are regular expressions (each regular expression should divide an instrument name into 2 parts: a root and an expiration).

Sample:

{
"futures": `/^(.+)([12]!|[FGHJKMNQUVXZ]\d{1,2})$/`,
"stock": `/^(.+)([12]!|[FGHJKMNQUVXZ]\d{1,2})$/`,
}

It will be applied to the instruments with futures and stock as a type. Refer to Symbol grouping for more information.

Type

Record<string, string>


symbols_types

Optional

List of filter descriptors.

Setting this property to undefined or an empty array leads to the absence of filter types in Symbol Search list. Use value = '' if you wish to include all filter types. value within the descriptor will be passed as symbolType argument to IDatafeedChartApi.searchSymbols

Type

DatafeedSymbolType[]


units

Optional

Supported unit groups. Each group can have several unit objects.

Example

{
weight: [
{ id: 'kg', name: 'kg', description: 'Kilograms' },
{ id: 'lb', name: 'lb', description: 'Pounds'},
]
}

Type

Record<string, Unit[]>