Skip to main content

Interface: DatafeedConfiguration

Datafeed.DatafeedConfiguration

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

Properties

currency_codes

Optional

currency_codes: (string | CurrencyItem)[]

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.

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

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

exchanges

Optional

exchanges: Exchange[]

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.


supported_resolutions

Optional

supported_resolutions: ResolutionString[]

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).

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

supports_marks

Optional

supports_marks: boolean

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


supports_time

Optional

supports_time: boolean

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


supports_timescale_marks

Optional

supports_timescale_marks: boolean

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


symbols_grouping

Optional

symbols_grouping: Record<string, string>

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.


symbols_types

Optional

symbols_types: DatafeedSymbolType[]

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


units

Optional

units: Record<string, Unit[]>

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

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