📄️ Getting Started
In this tutorial, we will see how to use TradingView's Advanced Charts API and plot DEX trading data with Bitquery APIs. Additionally, this tutorial will show how to use TradingView subscriptions to calculate OHLC in real-time. You can find the complete code of the tutorial here.
📄️ Getting Historical Data
In this section, we will write the code to get historical OHLC data to populate chart with candlesticks upto current timestamp. Create a new file called histOHLC.js and add the following code. Each part of the code is explained below.
📄️ Calculating Real-time OHLC
In this section, we will create a real-time subscription to DEX trade data from the Solana API using WebSocket, processes incoming trades, and calculates OHLC (Open, High, Low, Close) data for one-minute intervals. To learn more about streaming Solana data via subscriptions, go here
📄️ Custom DataFeed Setup
In this section, we will create a custom DataFeed for TradingView's Advanced Charting Library, integrating historical OHLC data and real-time data subscription. We will use three main files:
📄️ Widget Creation
Now that we have setup a custom DataFeed, we need to create the TradingView Widget.
📄️ Setting Up App.js
To complete the setup and run the chart, we need to call the TVChartContainer component inside the main App.js file. Here's the process: