Module: Datafeed
Datafeed JS API for TradingView Advanced Charts
Enumerations
Interfaces
- Bar
- CurrencyItem
- DOMData
- DOMLevel
- DatafeedConfiguration
- DatafeedQuoteValues
- DatafeedSymbolType
- Exchange
- HistoryMetadata
- IDatafeedChartApi
- IDatafeedQuotesApi
- IExternalDatafeed
- LibrarySubsessionInfo
- LibrarySymbolInfo
- Mark
- MarkCustomColor
- PeriodParams
- QuoteDataResponse
- QuoteErrorData
- QuoteOkData
- SearchSymbolResultItem
- SymbolInfoPriceSource
- SymbolResolveExtension
- TimescaleMark
- Unit
Type Aliases
CustomTimezones
Ƭ CustomTimezones: "Africa/Cairo" | "Africa/Casablanca" | "Africa/Johannesburg" | "Africa/Lagos" | "Africa/Nairobi" | "Africa/Tunis" | "America/Anchorage" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/El_Salvador" | "America/Juneau" | "America/Lima" | "America/Los_Angeles" | "America/Mexico_City" | "America/New_York" | "America/Phoenix" | "America/Santiago" | "America/Sao_Paulo" | "America/Toronto" | "America/Vancouver" | "Asia/Almaty" | "Asia/Ashkhabad" | "Asia/Bahrain" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Dubai" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Qatar" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Taipei" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Yangon" | "Atlantic/Azores" | "Atlantic/Reykjavik" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Lisbon" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Warsaw" | "Europe/Zurich" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Honolulu" | "Pacific/Norfolk" | "US/Mountain"
DOMCallback
Ƭ DOMCallback: (data: DOMData) => void
Type declaration
▸ (data): void
Parameters
| Name | Type |
|---|---|
data | DOMData |
Returns
void
DatafeedErrorCallback
Ƭ DatafeedErrorCallback: (reason: string) => void
Type declaration
▸ (reason): void
Parameters
| Name | Type |
|---|---|
reason | string |
Returns
void
GetMarksCallback
Ƭ GetMarksCallback<T>: (marks: T[]) => void
Type parameters
| Name |
|---|
T |
Type declaration
▸ (marks): void
Parameters
| Name | Type |
|---|---|
marks | T[] |
Returns
void
HistoryCallback
Ƭ HistoryCallback: (bars: Bar[], meta?: HistoryMetadata) => void
Type declaration
▸ (bars, meta?): void
Parameters
| Name | Type |
|---|---|
bars | Bar[] |
meta? | HistoryMetadata |
Returns
void
LibrarySessionId
Ƭ LibrarySessionId: "regular" | "extended" | "premarket" | "postmarket"
MarkConstColors
Ƭ MarkConstColors: "red" | "green" | "blue" | "yellow"
Nominal
Ƭ Nominal<T, Name>: T & { [species]: Name }
This is the generic type useful for declaring a nominal type, which does not structurally matches with the base type and the other types declared over the same base type
Usage:
Example
type Index = Nominal<number, 'Index'>;
// let i: Index = 42; // this fails to compile
let i: Index = 42 as Index; // OK
Example
type TagName = Nominal<string, 'TagName'>;
Type parameters
| Name | Type |
|---|---|
T | T |
Name | extends string |
OnReadyCallback
Ƭ OnReadyCallback: (configuration: DatafeedConfiguration) => void
Type declaration
▸ (configuration): void
Parameters
| Name | Type |
|---|---|
configuration | DatafeedConfiguration |
Returns
void
QuoteData
Ƭ QuoteData: QuoteOkData | QuoteErrorData
QuotesCallback
Ƭ QuotesCallback: (data: QuoteData[]) => void
Callback to provide Quote data.
Type declaration
▸ (data): void
Parameters
| Name | Type | Description |
|---|---|---|
data | QuoteData[] | Quote Data |
Returns
void
QuotesErrorCallback
Ƭ QuotesErrorCallback: (reason: string) => void
Error callback for quote data request.
Type declaration
▸ (reason): void
Parameters
| Name | Type | Description |
|---|---|---|
reason | string | message describing the reason for the error |
Returns
void
ResolutionString
Ƭ ResolutionString: Nominal<string, "ResolutionString">
Resolution or time interval is a time period of one bar. Advanced Charts supports tick, intraday (seconds, minutes, hours), and DWM (daily, weekly, monthly) resolutions. The table below describes how to specify different types of resolutions:
| Resolution | Format | Example |
|---|---|---|
| Ticks | xT | 1T — one tick, 5T — five ticks, 100T — one hundred ticks |
| Seconds | xS | 1S — one second |
| Minutes | x | 1 — one minute |
| Hours | x minutes | 60 — one hour |
| Days | xD | 1D — one day |
| Weeks | xW | 1W — one week |
| Months | xM | 1M — one month |
| Years | xM months | 12M — one year |
Refer to Resolution for more information.
ResolveCallback
Ƭ ResolveCallback: (symbolInfo: LibrarySymbolInfo) => void
Type declaration
▸ (symbolInfo): void
Parameters
| Name | Type |
|---|---|
symbolInfo | LibrarySymbolInfo |
Returns
void
SearchSymbolsCallback
Ƭ SearchSymbolsCallback: (items: SearchSymbolResultItem[]) => void
Type declaration
▸ (items): void
Parameters
| Name | Type |
|---|---|
items | SearchSymbolResultItem[] |
Returns
void
SeriesFormat
Ƭ SeriesFormat: "price" | "volume"
ServerTimeCallback
Ƭ ServerTimeCallback: (serverTime: number) => void
Type declaration
▸ (serverTime): void
Parameters
| Name | Type |
|---|---|
serverTime | number |
Returns
void
SubscribeBarsCallback
Ƭ SubscribeBarsCallback: (bar: Bar) => void
Type declaration
▸ (bar): void
Parameters
| Name | Type |
|---|---|
bar | Bar |
Returns
void
TimeScaleMarkShape
Ƭ TimeScaleMarkShape: "circle" | "earningUp" | "earningDown" | "earning"
Timezone
Ƭ Timezone: "Etc/UTC" | CustomTimezones
VisiblePlotsSet
Ƭ VisiblePlotsSet: "ohlcv" | "ohlc" | "c" | "hlc"