-
Notifications
You must be signed in to change notification settings - Fork 3
Frequently Asked Questions
1. How do I connect my data? How to add new ticker symbols?
The Charting Library should be used by technical specialists. It requires advanced skills in JavaScript and deep knowledge of WEB protocols. You should know it yourself or have/hire people who know this. Additionally, if you don't have a WEB API, you will need at least a server language programmer and a system administrator to implement a WEB API on the server side.
We’ve done a lot of work to make the process of connecting data simple and clear.
First, you need to read and understand this article: How to connect my data
If you still have questions, open Demo Chart, then open Debugger-Network and filter requests by demo_feed
. You will see all requests and corresponding responses in the UDF format.
2. Do you have an example of JS API implementation?
The UDF Adapter is an example of the JS API implementation. Its code is not minified and it is written in such a way that our clients can understand how it works.
3. Do you have an example of a WebSocket data transport?
You can find an example of WebSocket streaming in the Tutorial.
4. Do you have an example of a back-end data feed on ASP.NET, Python, PHP etc. ?
The only example of a back-end feed that we have is written on Javascript for NodeJS. You can find it here: yahoo_datafeed
5. How can I display my data stored in a TXT/CSV/Excel file?
First of all, the Charting Library is not intended to display data from files. It is used to display bars data from a server. Secondly, you should keep in mind that according to the agreement you should use Charting Library on public websites only. If you still want to use a file as the source of data you will need to do the following steps:
-
Write an application using any server language (.NET, PHP, NodeJS, Python, etc.). This application should read the file and provide the data from it in UDF format over HTTP(S).
Note: You can provide data in another format or use a WebSocket to transfer it, but in this case you will need to implement a JS API adapter on a client.
-
You should either have a static IP or register a domain so a browser can send requests to your server.
-
Open
index.html
and replacedemo_feed.tradingview.com
with the URL to your server.
6. Why my data is not displayed / displayed incorrectly / incorrectly fetched from a server?
The first thing you should do is open index.html
or your script where you create the library widget and put the following line in the initialization options of the widget: debug: true,
.
Once you have done that, you will see lots of helpful information in your browser console.
Most of important actions that happen in the library are explained in the console.
Please read Symbology thoroughly. Most of errors with data happen because of incorrect symbol settings.
7. Charting Library is constantly asking for data. How to tell it that data is finished?
Specifically for this purpose, there is a flag that can be added to the responses from your server that tells the library that there is no more data on the server.
It is called no_data
for UDF and noData
for JS API
8. How to change the number of decimal places of prices on a chart?
Please read Symbology thoroughly. The number of decimal places is calculated based on minmov
and pricescale
values.
9. What if I have a single price for each timestamp?
You still can display your data if you have only one price for each timestamp, but obviously you will not be able to display the data as bars/candles. Since the library is intended to display different styles of data: candles, bars, histogram, you are supposed to provide Open, High, Low, Close and optional Volume for each timestamp. If you have only one price, you can pass Open = High = Low = Close = price
. For better view of this data, you can change the default chart style to “Line” (see GUI Questions).
1. How can I subscribe to chart events?
We have a few ways to subscribe to the events:
- Subscribing to general events that are related to a whole chart layout, not a specific chart. Open article
- Subscribing to events that are related to a single chart Open article
Check the result value of subscription methods.
Some of them return a Subscription object that has methods subscribe
/unsubscribe
. The others accept a callback function.
2. How to change default bars style from Candles to another one?
You need to use overrides of the Widget Constructor. Add mainSeriesProperties.style
key. You can find allowed values in this article
3. How can I change the list of resolutions (time intervals) on a chart / make them grayed?
- List of the resolutions displayed in a pop-up on a chart is defined by supported_resolutions from the data feed configuration.
- Resolutions available for a certain instrument are defined by supported_resolutions from the instrument/symbol information.
- If you support intraday resolutions, you need to set has_intraday
- Additionally, if you support seconds, you need to set has_seconds
- If you support daily resolutions, you should set has_daily
- If you support weeks and months, you should set has_weekly_and_monthly
- Additionally, you should set the resolutions, which are provided by your server for intraday resolutions and separately for seconds.
- If an instrument supports (
supported_resolutions
) more resolutions that can be provided by the server (intraday_multipliers
), the other resolutions are constructed by the chart.
4. How to hide a GUI Element (symbol, interval, button etc.)?
- Most of GUI elements can be hidden using Featuresets. Please look at the Interactive map of featuresets to find what you need.
- There are base elements that cannot be hidden, but if you still want to get rid of them you can use CSS customization. Please note that the names, classes, and identifiers of DOM elements may be changed in future versions of the product without any notifications.
1. What is the the difference between Widget, Charting Library, and Trading Terminal?
-
Widget is connected to TradingView data. Perfect for websites, blogs, and forums where you need a fast & free solution.
Integration is simply cutting & pasting pre-made iframe code. It has lots of display modes.
-
Charting Library is a chart with your data.
This is a standalone solution that you download, host on your servers, connect your data & use in your site/app for free.
-
Trading Terminal is a standalone product that is licensed to brokers.
It includes all features available in the Charting Library, but it also has trading functionality, multiple chart layouts, watchlists, details, news widgets, and other advanced tools.
It has its own licensing fees associated with it.
2. How do I add a custom indicator?
At the moment there is only one way to add custom indicators. It is described in a dedicated article.
3. Does Charting Library support `rocket-loader` by CloudFlare?
No, it doesn't. Please avoid using it.
API Reference
Customisation by areas
- Global
- Toolbars
- Chart
- Symbol Search
- Legend
- Price Scale
- Time Scale
- Marks
- Indicators
- Snapshots
- Drawings
- Watchlist
- News
Creating Custom Studies