Issue
Iam building a website for bitcoin exchange. I want to use trading view charting library I extracted it in my workspace. I want to know how to give my own datafeed. Which format should datafeed file be in (like php,js,json) ?
var _datafeed = new Datafeeds.UDFCompatibleDatafeed("http://localhost/workspace/charting");
//var _datafeed = new Datafeeds.UDFCompatibleDatafeed("https://demo_feed.tradingview.com");
TradingView.onready(function () {
var widget = window.tvWidget = new TradingView.widget({
debug: true, // uncomment this line to see Library errors and warnings in the console
fullscreen: false,
symbol: 'A',
interval: 'D',
timezone: "America/New_York",
container_id: "tv_chart_container",
locale: getParameterByName('lang') || "en",
datafeed: _datafeed,
library_path: "charting_library/",
});
});
In above code the charts are plotted with demo link. when I change it to my path, I get 'invalid symbol' error. Where do I specify config and symbol_info and what's their file format? Iam a total newbie. Please help .
Any suggestion to move in the right way is appreciated. I am STUCK!!
Solution
You should write a php file and .htaccess in a folder within charting library. htaccess should rewrite all requests to that folder to that php file. Then in that php file echo results in UDF format.
UDF format and required api calls with sample result
UPDATE: Trading view charting library is a private repository. so you need to agree to their terms to get access the library and wiki pages on github.
Answered By - SMJ Answer Checked By - Marie Seifert (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.