Sample implementation of server-side UDF-compatible data source for Binance exchange for TradingView Charting Library.
$ npm install
$ npm start
Default port is 80.
$ docker build . -t udf
$ docker run -p 8080:80 udf
In browser open:
http://localhost/symbols?symbol=ETHBTC
or
http://localhost:8080/symbols?symbol=ETHBTC
if you start from docker with port 8080.
Take library from TradingView repo.
Open index.html
and find new TradingView.widget({})
and setup config:
- set
symbol
toBTCUSDT
- set
datafeed
tonew Datafeeds.UDFCompatibleDatafeed('http://localhost')
ornew Datafeeds.UDFCompatibleDatafeed('http://localhost:8080')
if you use port 8080.
For example you can use http-server to serve library. In library directory write commands in terminal:
$ npm install -g http-server
$ http-server -p 3000
Check in browser: