Files
ai/charting_library/datafeed-api.d.ts
ejukovskiy 261fc36962 VERSION 16 @ 2020-07-17 13:08:09.461606
Volume transparency bars #5076
widget.changeTheme should not record an Undo entry in the Undo/Redo stack #4982
Event when source price scale is changed #4884
Time value in shape creating #4878
Price axis icons don't change after applyOverrides #4865
Cannot disable bottom toolbar timezone menu via "timezone_menu" property #4836
Showleftaxis is not valid on the mobile #4828
Fix TypeScript typings for onVisibleRangeChanged method #4802
Invalid on Mobile: 'paneProperties.legendProperties.showBarChange': false,  #4797
API to attach an indicator to a particular price scale #4788
saveLoadAdapter is stringified #4776
Changing price scale of the study via changePriceScale method doesn't applies immediately #4774
Broker Config Order Market not visible #4765
[Bug] In the trading mask changing price doesn't update pips #4761
Maximize chart button #4744
Custom study plot color has no effect #4740
Moving average on seconds (createStudy) #4730
[Bug] BUY button get enable after clicking on both pips fields #4718
Overrides are not applied when defaults button is pressed #4706
Trading Terminal passes parentOrderId object while modifying the order #4705
Watermark settings are not saved to LocalStorage #4681
tvWidget.activeChart().resolution() return randomly "D" or "1D" for the daily time-frame #4630
cannot override default background color #4621
Bring to front operation is unavailable in 1.16 #4611
New style of pane buttons #4608
New mobile friendly style of the legend #4607
Centered Zoom with Ctrl #4606
TERMINAL: Apply Date Range to all charts in layout if Sync Interval is enabled #4605
Updated style of the measure tool #4604
New style of indicator loading status #4603
New measure styles #4602
Adaptive drawings dialogs #4600
Allow createStudy use undo #4590
Crosshair only on long press on mobile #4574
saveChartToServer does not call the callbacks if  !autoSaveNeeded #4573
How to get current theme? #4534
getAllShapes returns trend_line instead of 'extended' #4507
hideMarksOnBar in v1.15 #4506
Trend_angle is not returned via getAllShapes #4498
 How to disable vertical scrolling on the mobile side #4483
Add support for holidays and exchange working days in session spec #4467
closePopupsAndDialogs : The screenshot popup is not being closed #4438
Redirect on TV homepage after mouse click release #4423
setBodyFont of position line tool doesn't work correctly #4353
subscribe('drawing_event') click is not working #4302
"Eraser" and "dot" cursors doesn't work on IE11 #4238
zOrder for shapes with saved layout #4219
Errors/warning in console after load chart #4196
Main series API #4169
Scrolling to the top - href=“#”  #4136
Tracking mode #4111
Order line drag with middle mouse button doesn't trigger onMove #4084
There are no values or na ​​in the legend of the additional symbol (compare/add) until hover the cursor on the chart #4058
closePopupsAndDialogs doesn't work for new indicators dialog #4051
toolbar_bg doesn't affect top toolbar #3998
Check if symbol sync is enabled #3997
DOM bottom buttons are missing tooltips #3979
Question about D or 1D resolution #3861
Twitter intent button Android app #3732
Avoid chart appending storage version and "study_templates or charts" to chartStorageAPI #3702
unexpected study id by assigning studies_access option #3630
Drawing shape on indicator/study #3408
Top header in fullscreen? #2610
Allow to modify end date of long/short position tool #2381
Chart can scroll with mouse movement but no button pressed down #1908
Adaptive design for Properties dialog #862
2020-07-17 16:08:28 +03:00

250 lines
9.1 KiB
TypeScript

/**
* 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'>;
*/
export declare type Nominal<T, Name extends string> = T & {
[Symbol.species]: Name;
};
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 = Nominal<string, 'ResolutionString'>;
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;
/**
* @example "20181105,20181107,20181112"
*/
holidays?: string;
/**
* @example "1900F4-2350F4,1000-1845:20181113;1000-1400:20181114"
*/
corrections?: 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;