VERSION 1.12 @ 2018-02-14 07:05:47.033501
Cannot read property 'contains' of null #2442 Terminal: custom sorting for account manager tables #2344 Datafeed not closed after removing chart #2270 order.setPrice() has stopped working #2267 Volume in DOM rounded to 0 #2255 Error on bars request and update order lines #2237 Console error: Uncaught (in promise) formatter not received #2228 DOME doesn't work in new version #2211 Add featureset to hide toolbars by default #2209 Add possibility to move studies through z-order #2187 Unexpected resolution values in getBars #2179 Session breaks line is stuck to the left on reload #2153 Typescript declaration has mistakes #2144 Terminal: cannot specify step less than 1 #2141 Namespace the types in charting_library.d.ts #2137 Widget logo showing momentarily on paid account #2132 Add API to apply overrides for created studies #2098 Baseline chart style #2097 How to hide legend "Data Provided by ICE Data services" #2046 Stoch RSI Calculation #2038 Customize loading screen #2012 Supertrend indicator #1950 Translations in market details widget #1946 "Track time" chart setting #1918 Add tabs for positions #1906 Trading Terminal: Notifications Log #1896 Previous Close Price Line #1843 Set Overlay/Compare styles using createStudy/overrides and applyStudiesOverrides #1812 Session under Symbol info is displaying wrong trading interval(s)? #1787 Add "Go to" specific date #1753 Add session breaks #1752 Allow users to specify a volume for the Long/Short Position drawing tools #1691 Add API to use own charts save/load adapter #1679 Drawing toolbar not available in mobile #1673 Typescript definitions #1591 Support for symbols containing lowercase letters #1581 createMultipointShape long_position stop&profit setting #1459 Cannot change awesome oscillator width #1213 New adaptive drawings panel #1145 Edit shapes, studies and series #1101 Hide an indicator with API #1025 VWAP INDICATOR #106
This commit is contained in:
220
charting_library/datafeed-api.d.ts
vendored
Normal file
220
charting_library/datafeed-api.d.ts
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
export declare type ResolutionString = string;
|
||||
export interface Exchange {
|
||||
value: string;
|
||||
name: string;
|
||||
desc: string;
|
||||
}
|
||||
export interface DatafeedSymbolType {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
export interface DatafeedConfiguration {
|
||||
exchanges?: Exchange[];
|
||||
supported_resolutions?: ResolutionString[];
|
||||
supports_marks?: boolean;
|
||||
supports_time?: boolean;
|
||||
supports_timescale_marks?: boolean;
|
||||
symbols_types?: DatafeedSymbolType[];
|
||||
}
|
||||
export declare type OnReadyCallback = (configuration: DatafeedConfiguration) => void;
|
||||
export interface IExternalDatafeed {
|
||||
onReady(callback: OnReadyCallback): void;
|
||||
}
|
||||
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 QuoteOkData {
|
||||
s: 'ok';
|
||||
n: string;
|
||||
v: DatafeedQuoteValues;
|
||||
}
|
||||
export interface QuoteErrorData {
|
||||
s: 'error';
|
||||
n: string;
|
||||
v: object;
|
||||
}
|
||||
export declare type QuoteData = QuoteOkData | QuoteErrorData;
|
||||
export declare type QuotesCallback = (data: QuoteData[]) => 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 declare type CustomTimezones = 'America/New_York' | 'America/Los_Angeles' | 'America/Chicago' | 'America/Phoenix' | 'America/Toronto' | 'America/Vancouver' | 'America/Argentina/Buenos_Aires' | 'America/El_Salvador' | 'America/Sao_Paulo' | 'America/Bogota' | 'America/Caracas' | 'Europe/Moscow' | 'Europe/Athens' | 'Europe/Berlin' | 'Europe/London' | 'Europe/Madrid' | 'Europe/Paris' | 'Europe/Rome' | 'Europe/Warsaw' | 'Europe/Istanbul' | 'Europe/Zurich' | 'Australia/Sydney' | 'Australia/Brisbane' | 'Australia/Adelaide' | 'Australia/ACT' | 'Asia/Almaty' | 'Asia/Ashkhabad' | 'Asia/Tokyo' | 'Asia/Taipei' | 'Asia/Singapore' | 'Asia/Shanghai' | 'Asia/Seoul' | 'Asia/Tehran' | 'Asia/Dubai' | 'Asia/Kolkata' | 'Asia/Hong_Kong' | 'Asia/Bangkok' | 'Pacific/Auckland' | 'Pacific/Chatham' | 'Pacific/Fakaofo' | 'Pacific/Honolulu' | 'America/Mexico_City' | 'Africa/Johannesburg' | 'Asia/Kathmandu' | 'US/Mountain';
|
||||
export declare type Timezone = 'UTC' | CustomTimezones;
|
||||
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;
|
||||
/**
|
||||
* 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 DOMLevel {
|
||||
price: number;
|
||||
volume: number;
|
||||
}
|
||||
export interface DOMData {
|
||||
snapshot: boolean;
|
||||
asks: DOMLevel[];
|
||||
bids: DOMLevel[];
|
||||
}
|
||||
export interface Bar {
|
||||
time: number;
|
||||
open: number;
|
||||
high: number;
|
||||
low: number;
|
||||
close: number;
|
||||
volume?: number;
|
||||
}
|
||||
export interface SearchSymbolResultItem {
|
||||
symbol: string;
|
||||
full_name: string;
|
||||
description: string;
|
||||
exchange: string;
|
||||
ticker: string;
|
||||
type: string;
|
||||
}
|
||||
export interface HistoryMetadata {
|
||||
noData: boolean;
|
||||
nextTime?: number | null;
|
||||
}
|
||||
export interface MarkCustomColor {
|
||||
color: string;
|
||||
background: string;
|
||||
}
|
||||
export declare type MarkConstColors = 'red' | 'green' | 'blue' | 'yellow';
|
||||
export interface Mark {
|
||||
id: string | number;
|
||||
time: number;
|
||||
color: MarkConstColors | MarkCustomColor;
|
||||
text: string;
|
||||
label: string;
|
||||
labelFontColor: string;
|
||||
minSize: number;
|
||||
}
|
||||
export interface TimescaleMark {
|
||||
id: string | number;
|
||||
time: number;
|
||||
color: MarkConstColors | string;
|
||||
label: string;
|
||||
tooltip: string[];
|
||||
}
|
||||
export declare type ResolutionBackValues = 'D' | 'M';
|
||||
export interface HistoryDepth {
|
||||
resolutionBack: ResolutionBackValues;
|
||||
intervalBack: number;
|
||||
}
|
||||
export declare type SearchSymbolsCallback = (items: SearchSymbolResultItem[]) => void;
|
||||
export declare type ResolveCallback = (symbolInfo: LibrarySymbolInfo) => void;
|
||||
export declare type HistoryCallback = (bars: Bar[], meta: HistoryMetadata) => void;
|
||||
export declare type SubscribeBarsCallback = (bar: Bar) => void;
|
||||
export declare type GetMarksCallback<T> = (marks: T[]) => void;
|
||||
export declare type ServerTimeCallback = (serverTime: number) => void;
|
||||
export declare type DomeCallback = (data: DOMData) => void;
|
||||
export declare type ErrorCallback = (reason: string) => void;
|
||||
export interface IDatafeedChartApi {
|
||||
calculateHistoryDepth?(resolution: ResolutionString, resolutionBack: ResolutionBackValues, intervalBack: number): HistoryDepth | undefined;
|
||||
getMarks?(symbolInfo: LibrarySymbolInfo, startDate: number, endDate: number, onDataCallback: GetMarksCallback<Mark>, resolution: ResolutionString): void;
|
||||
getTimescaleMarks?(symbolInfo: LibrarySymbolInfo, startDate: number, endDate: 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?(symbolInfo: LibrarySymbolInfo, callback: DomeCallback): string;
|
||||
unsubscribeDepth?(subscriberUID: string): void;
|
||||
}
|
||||
|
||||
export as namespace TradingView;
|
||||
Reference in New Issue
Block a user