我正在尝试克隆交易视图api。我检查了他们提供的github样本,并找到了以下代码:
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"
}
});
我了解所提供的数据来自网址“http://yourhost/tradingview”。任何人都可以帮我找到该网址提供的数据格式。提前致谢
答案 0 :(得分:1)
尝试使用get方法用邮递员访问所有这些url。它将为您提供适当的数据格式响应。 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;
答案 1 :(得分:0)
使用此代码
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;
}
}
}
并且还使用plugin.js作为persiandate