Skip to content

This is a sample project that is implemented to provide TradingView Charting Library UDF data from Binance exchange.

License

Notifications You must be signed in to change notification settings

vsadeghizade/tradingview-udf-binance-websocket

Repository files navigation

TradingView Charting Library UDF Data Source

License: MIT

This is a sample code to implement UDF-compatible data source from Binance exchange for TradingView Charting Library by using node-binance-api library and Redis data store to increase response speed.

Built With

  • Node.js
  • Express.js
  • Redis

Packages Used

  • node-binance-api-modified-futures - The project to interact with the Binance API
  • Express-validator - Validator and sanitizer functions
  • Promise - Handle the result of an asynchronous task
  • ioredis - A fast, open source, in-memory, key-value data store.
  • Apidoc - API documantation

Prerequisite

  • Node & npm
  • Redis

Installation

npm install

Setup Redis

You should set your Redis configration in (/config/config.json)

Run

npm start

Docker

docker build . -t <your username>/tradingview-udf-binance
docker run -p 3000:3000 -d <your username>/tradingview-udf-binance

Default port is 3000.

Test

In browser open: http://localhost:3000/symbols?symbol=BTCUSDT

Test with Chart Library

Take library from TradingView repo. Open index.html and find new TradingView.widget({}) and setup config:

Set symbol to BTCUSDT Set datafeed to new Datafeeds.UDFCompatibleDatafeed('http://localhost:3000')

Contributing

All contributions welcome.

Credits

License

The MIT License (MIT)

Links