-
Notifications
You must be signed in to change notification settings - Fork 0
Symbology
The Charting Library uses your own data where you define the symbology yourself. You may name the symbols as you see fit.
But there are some fine points that you should be aware of:
-
Our own symbology assumes that symbol names use
EXCHANGE:SYMBOLformat. The Library supports this by default. You may continue using if it meets your requirements. -
If you already have or considering a different symbology then you might want to use the
tickerfield.tickeris the unique identifier of the symbol that is used only inside the Library. Your users will never be able to see it. Simply enter thetickervalues in all of your SymbolInfo objects and Symbol Search results and expect that the Charting Library will request the data based on those values.
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:
It's the name of the symbol. It is a string that your users will be able to see. Also, it will be used for data requests if you are not using tickers.
It's an unique identifier for this particular symbol in your symbology.
If you specify this property then its value will be used for all data requests for this symbol. ticker will be treated the same as name if not specified explicitly.
Description of a symbol. Will be displayed in the chart legend for this symbol.
Optional type of the instrument.
Possible types are:
stockindexforexfuturesbitcoinexpressionspreadcfd- or another string value.
Trading hours for this symbol. See the Trading Sessions article to learn more details.
Both of these fields are expected to have a short name of the exchange where this symbol is traded.
The name will be displayed in the chart legend for this symbol.
Timezone of the exchange for this symbol. We expect to get the name of the time zone in olsondb format.
Supported timezones are:
Etc/UTCAfrica/CairoAfrica/JohannesburgAfrica/LagosAmerica/Argentina/Buenos_AiresAmerica/BogotaAmerica/CaracasAmerica/ChicagoAmerica/El_SalvadorAmerica/JuneauAmerica/LimaAmerica/Los_AngelesAmerica/Mexico_CityAmerica/New_YorkAmerica/PhoenixAmerica/SantiagoAmerica/Sao_PauloAmerica/TorontoAmerica/VancouverAsia/AlmatyAsia/AshkhabadAsia/BahrainAsia/BangkokAsia/ChongqingAsia/DubaiAsia/Ho_Chi_MinhAsia/Hong_KongAsia/JakartaAsia/JerusalemAsia/KathmanduAsia/KolkataAsia/KuwaitAsia/MuscatAsia/QatarAsia/RiyadhAsia/SeoulAsia/ShanghaiAsia/SingaporeAsia/TaipeiAsia/TehranAsia/TokyoAtlantic/ReykjavikAustralia/ACTAustralia/AdelaideAustralia/BrisbaneAustralia/PerthAustralia/SydneyEurope/AthensEurope/BelgradeEurope/BerlinEurope/CopenhagenEurope/HelsinkiEurope/IstanbulEurope/LondonEurope/LuxembourgEurope/MadridEurope/MoscowEurope/OsloEurope/ParisEurope/RigaEurope/RomeEurope/StockholmEurope/TallinnEurope/VilniusEurope/WarsawEurope/ZurichPacific/AucklandPacific/ChathamPacific/FakaofoPacific/HonoluluPacific/NorfolkUS/Mountain
These four keys have different meanings when used for common and fractional prices.
MinimalPossiblePriceChange = minmov / pricescale
-
minmovis the amount of price precision steps for 1 tick. For example, since the tick size for U.S. equities is0.01,minmovis 1. But the price of the E-mini S&P futures contract moves upward or downward by0.25increments, so theminmovis25. -
pricescaledefines the number of decimal places. It is10^number-of-decimal-places. If a price is displayed as1.01,pricescaleis100; If it is displayed as1.005,pricescaleis1000. -
minmove2for common prices is0or it can be skipped. -
fractionalfor common prices isfalseor it can be skipped.
Example:
Typical stock with 0.01 price increment: minmov = 1, pricescale = 100, minmove2 = 0.
Fractional prices are displayed 2 different forms: 1) xx'yy (for example, 133'21) 2) xx'yy'zz (for example, 133'21'5).
-
xxis an integer part. -
minmov/pricescaleis a Fraction. -
minmove2is used in form 2. -
fractionalistrue
Example:
If minmov = 1, pricescale = 128 and minmove2 = 4:
-
119'16'0represents119 + 16/32 -
119'16'2represents119 + 16.25/32 -
119'16'5represents119 + 16.5/32 -
119'16'7represents119 + 16.75/32
More examples:
-
ZBM2014 (T-Bond)with1/32:minmov = 1,pricescale = 32,minmove2 = 0 -
ZCM2014 (Corn)with2/8:minmov = 2,pricescale = 8,minmove2 = 0 -
ZFM2014 (5 year t-note)with1/4 of 1/32:minmov = 1,pricescale = 128,minmove2 = 4
Default: false
Boolean value showing whether the symbol includes intraday (minutes) historical data.
If it's false then all buttons for intraday resolutions will be disabled for this particular symbol.
If it is set to true, all resolutions that are supplied directly by the datafeed must be provided in intraday_multipliers array.
An array of resolutions which should be enabled for this symbol.
Each item of an array is expected to be a string. Format is described in another article.
If one changes the symbol and new symbol does not support the selected resolution then resolution will be switched to the first available one in the 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 timeframes too. The timeframe will not be available if it requires the resolution that is not supported.
Default: []
Array of resolutions (in minutes) supported directly by the data feed.
Each such resolution may be passed to, and should be implemented by, getBars.
The default of [] means that the data feed supports aggregating by any number of minutes.
If the data feed only supports certain minute resolutions but not the requested resolution, getBars will be called (repeatedly if needed) with a higher resolution as a parameter, in order to build the requested resolution.
For example, if the data feed only supports minute resolution, set intraday_multipliers to ['1'].
When the user wants to see 5-minute data, getBars will be called with the resolution set to 1 until the library builds all the 5-minute resolution by itself.
Default: false
Boolean value showing whether the symbol includes seconds in the historical data.
If it's false then all buttons for resolutions that include seconds will be disabled for this particular symbol.
If it is set to true, all resolutions that are supplied directly by the data feed must be provided in seconds_multipliers array.
Default: []
It is an array containing resolutions that include seconds (excluding postfix) that the data feed provides.
E.g., if the data feed supports resolutions such as ["1S", "5S", "15S"], but has 1-second bars for some symbols then you should set seconds_multipliers of this symbol to [1]. This will make Charting Library build 5S and 15S resolutions by itself.
Default: false
The boolean value showing whether data feed has its own daily resolution bars or not.
If has_daily = false then Charting Library will build the respective resolutions using 1-minute bars by itself. If not, then it will request those bars from the data feed.
Default: false
The boolean value showing whether data feed has its own weekly and monthly resolution bars or not.
If has_weekly_and_monthly = false then Charting Library will build the respective resolutions using daily bars by itself. If not, then it will request those bars from the data feed.
Default: false
The boolean value showing whether the library should generate empty bars in the session when there is no data from the data feed for this particular time.
I.e., if your session is 0900-1600 and your data has gaps between 11:00 and 12:00 and your has_empty_bars is true, then the Library will fill the gaps with bars for this time.
Default: true
The boolean value showing whether the library should filter bars using the current trading 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, then the Library will remove bars that don't belong to the trading session from your data.
Default: false
Boolean showing whether the symbol includes volume data or not.
Default: 0
Integer showing typical volume value decimal places for a particular symbol. 0 means volume is always an integer. 1 means that there might be 1 numeric character after the comma.
The status code of a series with this symbol. The status is shown in the upper right corner of a chart.
Supported statuses are:
streamingendofdaypulseddelayed_streaming
Default: false
Boolean value showing whether this symbol is an expired futures contract or not.
Unix timestamp of the expiration date. One must set this value when expired = true.
Charting Library will request data for this symbol starting from that time point.
Sector for stocks to be displayed in the Symbol Info.
Industry for stocks to be displayed in the Symbol Info.
Currency to be displayed in the Symbol Info.
- What is Charting Library
- Getting Started
- Data Binding
- Chart Customization
- Customization Overview
- Client-Side Customization
- Server-Side Customization
- Customization Use Cases
- Trading Terminal
- Saving/Loading Charts
- Creating Custom Studies
- Breaking changes in versions