Frequently Asked Questions
If your question is not outlined below, you can ask it on GitHub Issues 🔐 (access is restricted) or join the Discord discussions.
Data Management
1. How do I connect my data? How to add new symbols?
Refer to the following articles for information on how to connect data:
Also, consider the Datafeed: Common Issues article to avoid typical errors when implementing the Datafeed API.
Use the Demo Chart to investigate how the library processes data. Open the Network tab in a browser console and filter requests by demo-feed
to see all data requests and responses.
2. Do you have an example of the Datafeed API implementation?
You can consider UDF Adapter 🔐 (access is restricted) as an example of the Datafeed API implementation.
If you need a step-by-step guide, refer to the How to connect data via Datafeed API tutorial.
3. Do you have an example of a WebSocket data transport?
The How to connect data via Datafeed API tutorial shows how to stream data using WebSocket.
4. Do you have an example of a backend datafeed in ASP.NET, Python, PHP, etc. ?
The only example of a backend datafeed that we have is written in JavaScript for Node.js. For more information, refer to the yahoo_datafeed repository.
5. How can I display data stored in a TXT/CSV/XLSX file?
The library is intended to display data from a server, not a file. You should also keep in mind that according to the license agreement you can use the library on public websites only. If you still want to use a file as a data source, complete the following steps:
Write an application using any server language (.NET, PHP, Node.js, Python, etc.). This application should read a file and transfer data from it in the 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 need a custom Datafeed API implementation.
Make sure a browser can send requests to your server. For this, you should either have a static IP or register a domain.
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 the server?
The first thing you should do to debug any issue is to enable console logs. These logs contain the most important actions performed in the library. You can also refer to the Datafeed: Common Issues article that might answer your question.
Note that most data issues occur because symbol information is set incorrectly. To avoid these issues, consider Symbology.
7. The library is constantly asking for data. How to tell it that the data is over?
To do this, you should use a flag that notifies the library that there is no more data on the server. Set the status code to no_data
or the noData
property to true
if you use UDF or Datafeed API, respectively.
8. How to change the number of decimal places for prices on the chart?
The number of decimal places depends on the pricescale
value. For more information on the price format, refer to the Symbology article.
9. What if I have a single price for each timestamp?
Since the library is intended to display multiple data types like candles, bars, and histograms, you are supposed to provide Open, High, Low, Close, and optional Volume for each timestamp. If you have a single price for each timestamp, you can pass Open = High = Low = Close = price
. For better data visualization, you can change the default chart style to “Line” (refer to the GUI section).
10. Why is `unsubscribeBars` called with a delay?
This is intentional.
Refer to the unsubscribeBars
method for more information.
11. How to specify time properties within the library?
All time properties should be Unix timestamps in seconds unless otherwise stated. For example, the code sample below specifies boundary values of a time range.
const from = Date.now() / 1000 - 500 * 24 * 3600; // 500 days ago
const to = Date.now() / 1000;
12. Does the library support the FIX protocol?
Advanced Charts / Trading Platform is a browser-based client-side solution. You can implement your backend data connection with any instruments, including the FIX protocol, based on your requirements. However, the library does not provide any pre-made data integrations with the FIX protocol.
The diagram below illustrates the data connection layers. You should integrate the FIX protocol between your backend and the data provider.
GUI
1. How can I subscribe to chart events?
You can subscribe to chart events in two ways:
Subscribe to general events that are related to a whole chart layout, not a specific chart.
Subscribe to events that are related to a single chart such as
isSelectBarRequested
.
Some methods that expose events only allow a subscription to be created by passing a single callback function, others return a Subscription object that can be used to subscribe and unsubscribe.
2. How to change the default bar style?
You can use the mainSeriesProperties.style
property to customize bar style.
Refer to the Chart Overrides article for information.
3. How to customize the chart style?
The library provides extensive customization options through multiple APIs. Refer to the Customization section for more information.
4. How can I change the list of resolutions (time intervals) on the chart / disable them?
Refer to the Resolution article for more information.
5. How to enable the resolution in seconds?
Refer to the Resolution in seconds section for more information.
6. How to hide a GUI element (symbol, interval, button, etc.)?
Most of GUI elements can be hidden using featuresets. There are base elements that cannot be hidden, but if you still want to get rid of them, you can use CSS customization. Note that names, classes, and identifiers of the DOM elements may be changed in the next versions of the product without any notifications.
7. Why do the Ask/Bid buttons not work?
Make sure you have implemented the getQuotes
method.
Localization
1. What languages does the library support? How can I add the language that is not supported?
The library supports a variety of languages. You can find the complete list in the Localization article. Note that it is impossible to add your own language support.
2. Could you provide the list of all UI strings so I can translate them?
We cannot provide the list of UI strings.
However, if you want to add custom translations,
you can use the custom_translate_function
property of the Widget Constructor.
Other Questions
1. What is the difference between Widget, Advanced Charts, and Trading Platform?
Widget is connected to the TradingView data. Perfect for websites, blogs, and forums where you need a fast & free solution.
Integration is simply copying & pasting pre-made iframe code. Widget has lots of display modes.
Advanced Charts is a chart with your data.
This is a standalone solution that you download, host on your servers, and connect your data to. You can use it in your site/app for free.
Trading Platform is a standalone product that is licensed to brokers.
It contains all features available in Advanced Charts and also includes trading functionality, multiple-chart layouts, watchlists, details, news widgets, and other advanced tools. Trading Platform has its own licensing fees associated with it.
2. How do I add a custom indicator?
Refer to Custom indicators for more information.
3. Does the library support Rocket Loader by Cloudflare?
No, it does not. Please avoid using Rocket Loader.
4. Do you provide iOS or Android SDKs like you do for Lightweight Charts?
No, not currently.
5. How to integrate the library with Flutter?
We do not have an example for integrating the library with Flutter currently. You can consider the How to Build a Native Communication Bridge in Flutter with WebView and JavaScript article that explains how to use Flutter with WebView and JavaScript.
6. How to switch from Advanced Charts to Trading Platform?
Refer to the Trading Platform topic for more information.
7. Is it possible to use Pine Script® for creating and editing indicators?
Pine Script® is not supported in Advanced Charts or Trading Platform. Alternatively, you can create your custom indicator using JavaScript. For more information, refer to Custom indicators.
8. Does Advanced Charts / Trading Platform support Alerts, Range Bars, and Bar Replay Tool?
Some features that are available on tradingview.com are not supported in the libraries, including Alerts, Range Bars, and Bar Replay Tool. Refer to the Unsupported features section for more information.
9. Why do I get error messages mentioning CSP or blob?
Content Security Policy (CSP) is a web security standard that helps prevent various types of attacks. CSP defines a policy specifying which domains are considered trusted sources for content such as scripts, images, fonts, and other resources.
The error message may look like the following:
Refused to load the image <URL>' because it violates the following Content Security Policy directive: "img-src 'self' blob data
Depending on your use cases, implementation, browser compatibility, or internal company policies, you may encounter issues with some library features. These could include displaying screenshots, logos, or using emojis/icons within the chart.
We encourage you to properly assess the situation and choose the appropriate solution by reading the Content Security Policy article.
When changing CSP is not allowed, you can enable the iframe_loading_compatibility_mode
featureset. This featureset will instead use about:blank
as the source URL and build the iframe HTML using document.write
.
The blob method is the preferred approach but this featureset offers a fallback for non-standard applications.