I am trying clone the trading view chart api. I have checked the github sample that they have provided and found the following code:
var _datafeed = new Datafeeds.UDFCompatibleDatafeed("http://yourhost/tradingview", 10000);
var _widget = window.tvWidget = new TradingView.widget({
symbol: 'AAPL',
fullscreen:true,
interval: '15',
container_id: "tv_chart_container",
datafeed: _datafeed,
library_path: "/charting_library/",
locale: getParameterByName('lang') || "en",
disabled_features: ["use_localstorage_for_settings", "header_symbol_search", "symbol_search_hot_key"],
debug: false,
overrides: {
"paneProperties.background": "#222222",
"paneProperties.vertGridProperties.color": "#454545",
"paneProperties.horzGridProperties.color": "#454545",
"symbolWatermarkProperties.transparency": 90,
"scalesProperties.textColor": "#AAA"
}
});
I understand that the data that is provided is given from url "http://yourhost/tradingview".Can anyone help me to find the format of data that is provided from that url. Thanks in advance
in component.ts use this code
customFormatters: {
dateFormatter: {
format: function (date) {
var days = ["شنبه", "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه"],
year = date.getUTCFullYear(),
month = date.getUTCMonth() + 1,
day = date.getUTCDate(),
result = day + "-" + month + "-" + year;
return days[date.getUTCDay() - 1] + " " + result;
}
}
}
And Also use plugin.js for persiandate
Try to hit all these url with postman using get method. it will give you response with proper data formate . 1. http://yourhost/config; 2. http://yourhost/time; 3. http://yourhost/symbols?symbol=AAPL; 4. http://yourhost/history?symbol=AAPL&resolution=D&from=1505817294&to=1536921354 ; 5. http://yourhost/timescale_marks?timescale_marks?symbol=AAPL&from=1505741400&to=2114361000&resolution=D ; 6. http://yourhost/marks;
Replace http://yourhost/ with : https://demo_feed.tradingview.com/