1 | initial version |
To configure the TradingView charting library chart to update automatically, follow these steps:
var chart = new TradingView.widget({
// ...
symbol: "AAPL",
// ...
});
chart.onChartReady(function() {
chart.setSymbol("AAPL", function() {
console.log("Symbol set");
});
});
var chart = new TradingView.widget({
// ...
symbol: "AAPL",
interval: "D",
// ...
});
chart.onChartReady(function() {
chart.setResolution("D", function() {
console.log("Interval set");
});
});
var chart = new TradingView.widget({
// ...
symbol: "AAPL",
interval: "D",
// ...
});
chart.onChartReady(function() {
chart.subscribeBars(function() {
console.log("Real-time updates enabled");
});
});
chart.onChartReady(function() {
chart.setSymbol("AAPL", function() {
chart.setResolution("D", function() {
chart.subscribeBars(function() {
chart.update({
time: new Date(),
close: 100.00,
open: 99.50,
high: 101.00,
low: 98.50,
volume: 1000000
});
});
});
});
});
By following these steps, you can configure the TradingView charting library chart to update automatically.