Symbology

Charting Library consumes your own data so symbology is 100% up to you. You may use whatever naming convention you want. Just return symbol info in Charting Library format and use arbitrary symbols names. Virtually, symbol name may be an arbitrary string containing any characters.

But there are some fine points you should know about:

  1. Our own symbology assumes symbols names have EXCHANGE:SYMBOL format. Surely Library supports this by default. So if you like it -- just keep calm and use it.
  2. Already having other symbology or just going to have one ? There is ticker term defined expecially for you. Ticker is symbol's unique identifier which is used only inside of Library. Your users will never see it. So just put ticker values in all of your SymbolInfo and Symbol Search results and expect Charting Library will ask you for data using those values.

SymbolInfo Structure

This section is extremely important. 72.2% of all issues experienced by Charting Library users are caused by wrong/malformed SymbolInfo data.

SymbolInfo is an object containing symbol metadata. This object is the result of resolving the symbol. SymbolInfo has following fields:

name

It's name of a symbol. It is a string which your users will see. Also, it will be used for data requests if you are not using tickers.

ticker

It's an unique identifier for this symbol in your symbology. If you specify this property then its value will be used for all data requests for this symbol. ticker is treated to be equal to symbol if not specified explicitly.

description

Description of a symbol. Will be printed in chart legend for this symbol.

type

Optional type of the instrument. Possible values: stock, index, forex, futures, bitcoin, expression, spread, cfd or another string value. Some types has specific processing in the chart.

session

Trading hours for this symbol. See the [[Trading Sessions|Trading Sessions]] article to know more details.

exchange, listed_exchange

For now both of this fields are expected to have short name of exchange where this symbol is traded. This name will be printed in chart's legend for this symbol. This field is not used for other purposes now.

timezone

Exchange timezone for this symbol. We expect to get name of time zone in olsondb format. Supported timezones are:

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/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
minmov, pricescale, minmove2, fractional

These three keys have different meaning when using for common prices and for fractional prices.

Common prices
 MinimalPossiblePriceChange = minmov / pricescale

minmov is a number of units that make up one tick. For example, U.S. equities are quotes in decimals, and tick in decimals, and can go up +/- 0.01.
So the tick increment is 1. But the e-mini S&P futures contract, though quoted in decimals, goes up in 0.25 increments, so the tick increment is 25.
pricescale defines number of decimal places. Actually it is 10^number-of-decimal-places. If a price is displayed as 1.01, pricescale is 100; If it is displayed as 1.005, pricescale is 1000.
minmove2 for common prices is 0 or it can be skipped.
fractional for common prices is false or it can be skipped.

Example:

Typical stock with 0.01 price increment: minmov = 1, pricescale = 100, minmove2 = 0
Fractional prices

Fractional prices are displayed as form 1 - xx'yy (for example, 133'21) or form 2 - xx'yy'zz (for example, 133'21'5).

xx is an integer part.

minmov/pricescale is a Fraction.

minmove2 is used in form 2.

fractional is true

Example:

If minmov = 1, pricescale = 128 and minmove2 = 4
119'16'0 represents 119 + 16/32
119'16'2 represents 119 + 16.25/32
119'16'5 represents 119 + 16.5/32
119'16'7 represents 119 + 16.75/32

More examples:

ZBM2014 (T-Bond) with 1/32: minmov = 1, pricescale = 32, minmove2 = 0
ZCM2014 (Corn) with 2/8: minmov = 2, pricescale = 8, minmove2 = 0
ZFM2014 (5 year t-note) with 1/4 of 1/32: minmov=1, pricescale=128, minmove2= 4
has_intraday <false>

Boolean showing whether symbol has intraday (minutes) history data. If it's false then all buttons for intradays resolutions will be disabled when this symbol is active in chart.
If it is set to true, all resolutions that are supplied directly by the datafeed must be provided in intraday_multipliers array.

supported_resolutions

An array of resolutions which should be enabled in resolutions picker for this symbol. Each item of an array is expected to be a string. Format is described in another [[article|Resolution]].

Resolutions treated as supported by datafeed (see datafeed configuration data) but not supported by the current symbol will be disabled in Resolution picker widget. If one changes the symbol and new symbol does not support the selected resolution then resolution will be switched to first one in supported resolutions list. Resolution availability logic (pseudocode):

resolutionAvailable  =
    resolution.isIntraday ?
       symbol.has_intraday && symbol.supports_resoluiton(resolution) :
    symbol.supports_resoluiton(resolution);

In case of absence of supported_resolutions in a symbol info all DWM resolutions will be available. Intraday resolutions will be available if has_intraday is true.

Supported resolutions affect available time frames too. The timeframe will not be available if it requires the resolution which is not supported.

intraday_multipliers <[]>

It is an array containing intraday resolutions (in minutes) the datafeed wants to build by itself. E.g., if the datafeed reported he supports resolutions ["1", "5", "15"], but in fact it has only 1 minute bars for symbol X, it should set intraday_multipliers of X = [1]. This will make Charting Library to build 5 and 15 resolutions by itself.

has_seconds <false>

Boolean showing whether symbol has sedonds history data. If it's false then all buttons for seconds resolutions will be disabled when this symbol is active in chart.
If it is set to true, all resolutions that are supplied directly by the datafeed must be provided in seconds_multipliers array.

seconds_multipliers <[]>

It is an array containing seconds resolutions (in seconds without a postfix) the datafeed wants to build by itself. E.g., if the datafeed reported he supports resolutions ["1S", "5S", "15S"], but in fact it has only 1 second bars for symbol X, it should set seconds_multipliers of X = [1]. This will make Charting Library to build 5S and 15S resolutions by itself.

has_daily <false>

The boolean value showing whether datafeed has its own D resolution bars or not. If has_daily = false then Charting Library will build respective resolutions from intraday by itself. If not, then it will request those bars from datafeed.

has_weekly_and_monthly <false>

The boolean value showing whether datafeed has its own W and M resolution bars or not. If has_weekly_and_monthly = false then Charting Library will build respective resolutions from D by itself. If not, then it will request those bars from datafeed.

has_empty_bars <false>

The boolean value showing whether the library should generate empty bars in session when there is no data from datafeed for this time. I.e., if your session is 0900-1600 and your real data lacks of trades between 11:00 and 12:00 and your has_empty_bars is true, then Library will paste degenerate bars in this time.

force_session_rebuild <true>

The boolean value showing whether library should filter bars using current session. If false, bars will be filtered only when the library builds data from another resolution or if has_empty_bars was set to true. If true, the Library will remove from your data those bars that does not belong to the trading session.

has_no_volume <false>

Boolean showing whether symbol has volume data or not.

volume_precision <0>

Integer showing typical volume value decimal places for this symbol. 0 means volume always in an integer. 1 means there may be 1 numeric character after comma and so on.

data_status

The status code of a series with this symbol. The status is shown in upper right corner of a chart. Supported values:

  • streaming
  • endofday
  • pulsed
  • delayed_streaming
expired <false>

Boolean showing whether this symbol is expired futures contract or not.

expiration_date

Unix timestamp of expiration date. One must set this value if expired = true. Charting Library will request data for this symbol starting from that time point instead of actual moment.

sector

Sector for stocks to be displayed in Symbol Info.

industry

Industry for stocks to be displayed in Symbol Info.

currency_code

Currency to be displayed in Symbol Info.

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,378评论 6 481
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,356评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 152,702评论 0 342
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,259评论 1 279
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,263评论 5 371
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,036评论 1 285
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,349评论 3 400
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,979评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,469评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,938评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,059评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,703评论 4 323
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,257评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,262评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,485评论 1 262
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,501评论 2 354
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,792评论 2 345

推荐阅读更多精彩内容