Files
ai/charting_library/datafeed-api.d.ts
Jenkins 967db57659 VERSION 1.15 @ 2019-12-18 11:58:16.705704
setVisibleRange additional argument - right margin % #4512
Indicators are slided when zooming chart #4456
save_load_adapter after removing chart #4454
Overriding timezone definitions #4449
Error while applying study template #4407
Wrong range of overlay after switching timeframe #4372
Intraday Data is Requesting from the server since 1970 #4366
Display price in thousands, millions, billions #4360
setBodyFont of position line tool doesn't work correctly #4353
Realtime updates shifts indicator's data for realtime bars count back #4283
Adaptive indicators dialogs #4247
Click instead of mouseDown for positionLine onClose. #4245
Add applyRightMargin flag to setVisibleRange #4233
Open volume on new pane if volume_force_overlay is enabled #4198
Keep the first visible point when a new bar comes #4188
getVisibleRange should return 00:00 for DWM #4187
21 more indicators #4170
Main series API #4169
Can not set Text property of the Note Shape #4144
Unable to hide legend #4126
setVisibleRange or getVisibleRange adds one more bar to the left #4110
Cannot set tooltip for order line #4079
Dialog is closed immediately if it is invoked from mouse_down event #4077
setVisibleRange doesn't work for multiple charts at once #4068
how to disable mp3 files being loaded? #4052
Increase spacing between bars to display short time periods #4043
Event Marker Placement always uses high #4042
Number cannot be passed as symbol into widget constructor #4039
custom_css_url not working in unstable branch #4017
ConfirmDialog does not close after YES is clicked #3981
Side DOM chart does not render in certain conditions #3975
`getAllShapes` does not return drawings loaded from state #3966
Text inside order/position lines is too small #3962
Removing the last saved chart #3954
get current chart timezone #3943
Text shape throws error setValue #3930
Wrong Symbol and Price values in context menu for secondary instrument. #3926
text override in Horizontal Line does not work #3918
Sticky magnet mode #3902
Add thin bars #3900
Event that study has been removed from the chart #3899
High-Low bars #3898
Multiple Y-axis #3897
Issue with Renko with volume and vwap indicators #3893
Layout rename doesn't send request to server #3878
Cannot create copy of copy of a chart layout #3872
Chart scrolls when tap on a trend line Safari/iphone7 #3871
Chart border overlap scale values #3826
IDatafeedChartApi.subscribeDepth parameters #3821
Error in console when restore defaults #3755
Timeframe is not precise #3722
Wrong year Ticker displayed on X axis if resolution < 2H #3678
New chart layouts #3629
Drawings disappear at certain resolutions #3594
Remove jQuery from loading custom indicator #3563
Align symbol labels #3513
createOrderLine().onMove broken in 1.13 #3480
When changing theme on the fly - chart type changing too #3459
Pivot Points Standard - path to some style params #3441
createMultipointShape overrides with dot don't work #3419
Add inverting price scale #3376
Transparent chart background color #3288
Previous timescale tooltips stay when switching currency #3165
disableSelection still shown the selections on hover #2864
Override symbol from saved_data #2493
Forecast balloon too short #2289
Context menu submenus cover up other options #2007
Add setVisiblePriceRange method #1408
Modify panes height/order #1232
Add custom Interval  #1191
2019-12-18 14:58:22 +03:00

226 lines
8.4 KiB
TypeScript

export declare type DomeCallback = (data: DOMData) => void;
export declare type ErrorCallback = (reason: string) => void;
export declare type GetMarksCallback<T> = (marks: T[]) => void;
export declare type HistoryCallback = (bars: Bar[], meta: HistoryMetadata) => void;
export declare type MarkConstColors = 'red' | 'green' | 'blue' | 'yellow';
export declare type OnReadyCallback = (configuration: DatafeedConfiguration) => void;
export declare type QuoteData = QuoteOkData | QuoteErrorData;
export declare type QuotesCallback = (data: QuoteData[]) => void;
export declare type ResolutionBackValues = 'D' | 'M';
export declare type ResolutionString = string;
export declare type ResolveCallback = (symbolInfo: LibrarySymbolInfo) => void;
export declare type SearchSymbolsCallback = (items: SearchSymbolResultItem[]) => void;
export declare type SeriesFormat = 'price' | 'volume';
export declare type ServerTimeCallback = (serverTime: number) => void;
export declare type SubscribeBarsCallback = (bar: Bar) => void;
export declare type Timezone = 'Etc/UTC' | CustomTimezones;
export interface Bar {
time: number;
open: number;
high: number;
low: number;
close: number;
volume?: number;
}
export interface DOMData {
snapshot: boolean;
asks: DOMLevel[];
bids: DOMLevel[];
}
export interface DOMLevel {
price: number;
volume: number;
}
export interface DatafeedConfiguration {
exchanges?: Exchange[];
supported_resolutions?: ResolutionString[];
supports_marks?: boolean;
supports_time?: boolean;
supports_timescale_marks?: boolean;
symbols_types?: DatafeedSymbolType[];
}
export interface DatafeedQuoteValues {
ch?: number;
chp?: number;
short_name?: string;
exchange?: string;
description?: string;
lp?: number;
ask?: number;
bid?: number;
spread?: number;
open_price?: number;
high_price?: number;
low_price?: number;
prev_close_price?: number;
volume?: number;
original_name?: string;
[valueName: string]: string | number | undefined;
}
export interface DatafeedSymbolType {
name: string;
value: string;
}
export interface Exchange {
value: string;
name: string;
desc: string;
}
export interface HistoryDepth {
resolutionBack: ResolutionBackValues;
intervalBack: number;
}
export interface HistoryMetadata {
noData: boolean;
nextTime?: number | null;
}
export interface IDatafeedChartApi {
calculateHistoryDepth?(resolution: ResolutionString, resolutionBack: ResolutionBackValues, intervalBack: number): HistoryDepth | undefined;
getMarks?(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback<Mark>, resolution: ResolutionString): void;
getTimescaleMarks?(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback<TimescaleMark>, resolution: ResolutionString): void;
/**
* This function is called if configuration flag supports_time is set to true when chart needs to know the server time.
* The charting library expects callback to be called once.
* The time is provided without milliseconds. Example: 1445324591. It is used to display Countdown on the price scale.
*/
getServerTime?(callback: ServerTimeCallback): void;
searchSymbols(userInput: string, exchange: string, symbolType: string, onResult: SearchSymbolsCallback): void;
resolveSymbol(symbolName: string, onResolve: ResolveCallback, onError: ErrorCallback): void;
getBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, rangeStartDate: number, rangeEndDate: number, onResult: HistoryCallback, onError: ErrorCallback, isFirstCall: boolean): void;
subscribeBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, onTick: SubscribeBarsCallback, listenerGuid: string, onResetCacheNeededCallback: () => void): void;
unsubscribeBars(listenerGuid: string): void;
subscribeDepth?(symbol: string, callback: DomeCallback): string;
unsubscribeDepth?(subscriberUID: string): void;
}
export interface IDatafeedQuotesApi {
getQuotes(symbols: string[], onDataCallback: QuotesCallback, onErrorCallback: (msg: string) => void): void;
subscribeQuotes(symbols: string[], fastSymbols: string[], onRealtimeCallback: QuotesCallback, listenerGUID: string): void;
unsubscribeQuotes(listenerGUID: string): void;
}
export interface IExternalDatafeed {
onReady(callback: OnReadyCallback): void;
}
export interface LibrarySymbolInfo {
/**
* Symbol Name
*/
name: string;
full_name: string;
base_name?: [string];
/**
* Unique symbol id
*/
ticker?: string;
description: string;
type: string;
/**
* @example "1700-0200"
*/
session: string;
/**
* Traded exchange
* @example "NYSE"
*/
exchange: string;
listed_exchange: string;
timezone: Timezone;
/**
* Prices format: "price" or "volume"
*/
format: SeriesFormat;
/**
* Code (Tick)
* @example 8/16/.../256 (1/8/100 1/16/100 ... 1/256/100) or 1/10/.../10000000 (1 0.1 ... 0.0000001)
*/
pricescale: number;
/**
* 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)
*/
minmov: number;
fractional?: boolean;
/**
* @example Quarters of 1/32: pricescale=128, minmovement=1, minmovement2=4
*/
minmove2?: number;
/**
* false if DWM only
*/
has_intraday?: boolean;
/**
* An array of resolutions which should be enabled in resolutions picker for this symbol.
*/
supported_resolutions: ResolutionString[];
/**
* @example (for ex.: "1,5,60") - only these resolutions will be requested, all others will be built using them if possible
*/
intraday_multipliers?: string[];
has_seconds?: boolean;
/**
* It is an array containing seconds resolutions (in seconds without a postfix) the datafeed builds by itself.
*/
seconds_multipliers?: string[];
has_daily?: boolean;
has_weekly_and_monthly?: boolean;
has_empty_bars?: boolean;
force_session_rebuild?: boolean;
has_no_volume?: boolean;
/**
* Integer showing typical volume value decimal places for this symbol
*/
volume_precision?: number;
data_status?: 'streaming' | 'endofday' | 'pulsed' | 'delayed_streaming';
/**
* Boolean showing whether this symbol is expired futures contract or not.
*/
expired?: boolean;
/**
* Unix timestamp of expiration date.
*/
expiration_date?: number;
sector?: string;
industry?: string;
currency_code?: string;
}
export interface Mark {
id: string | number;
time: number;
color: MarkConstColors | MarkCustomColor;
text: string;
label: string;
labelFontColor: string;
minSize: number;
}
export interface MarkCustomColor {
color: string;
background: string;
}
export interface QuoteErrorData {
s: 'error';
n: string;
v: object;
}
export interface QuoteOkData {
s: 'ok';
n: string;
v: DatafeedQuoteValues;
}
export interface SearchSymbolResultItem {
symbol: string;
full_name: string;
description: string;
exchange: string;
ticker: string;
type: string;
}
export interface TimescaleMark {
id: string | number;
time: number;
color: MarkConstColors | string;
label: string;
tooltip: string[];
}
export type CustomTimezones = 'Africa/Cairo' | 'Africa/Johannesburg' | 'Africa/Lagos' | '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/Dubai' | 'Asia/Ho_Chi_Minh' | 'Asia/Hong_Kong' | 'Asia/Jakarta' | 'Asia/Jerusalem' | 'Asia/Kathmandu' | 'Asia/Kolkata' | 'Asia/Kuwait' | 'Asia/Muscat' | 'Asia/Qatar' | 'Asia/Riyadh' | 'Asia/Seoul' | 'Asia/Shanghai' | 'Asia/Singapore' | 'Asia/Taipei' | 'Asia/Tehran' | 'Asia/Tokyo' | 'Atlantic/Reykjavik' | 'Australia/ACT' | 'Australia/Adelaide' | 'Australia/Brisbane' | 'Australia/Perth' | 'Australia/Sydney' | 'Europe/Athens' | 'Europe/Belgrade' | 'Europe/Berlin' | 'Europe/Copenhagen' | 'Europe/Helsinki' | 'Europe/Istanbul' | 'Europe/London' | 'Europe/Luxembourg' | 'Europe/Madrid' | 'Europe/Moscow' | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Riga' | 'Europe/Rome' | 'Europe/Stockholm' | 'Europe/Tallinn' | 'Europe/Vilnius' | 'Europe/Warsaw' | 'Europe/Zurich' | 'Pacific/Auckland' | 'Pacific/Chatham' | 'Pacific/Fakaofo' | 'Pacific/Honolulu' | 'Pacific/Norfolk' | 'US/Mountain';
export as namespace TradingView;