# Bitquery API integration with TradingView Technical Analysis Charts (DEX APIs)

**URL:** https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244
**Category:** GraphQL Tutorials
**Tags:** tradingview, reactjs
**Created:** [June 28, 2021, 10:31am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244 "2021-06-28T10:31:36Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)
#### Post date: [July 1, 2021, 8:25am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/23 "2021-07-01T08:25:28Z")

</div>

Try running the code below in our [GraphQL IDE](https://graphql.bitquery.io/ide) and you’ll get the data relevant to Candlestick charts.

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      options: {asc: "timeInterval.minute"}
      date: {since: "2021-06-20T07:23:21.000Z", till: "2021-06-23T15:23:21.000Z"}
      exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
      baseCurrency: {is: "0x2170ed0880ac9a755fd29b2688956bd959f933f8"},
      quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"},
      tradeAmountUsd: {gt: 10}
    ) 
    {
      timeInterval {
        minute(count: 15, format: "%Y-%m-%dT%H:%M:%SZ")  
      }
      volume: quoteAmount
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price) 
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![Rio](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@Rio](https://community.bitquery.io/u/Rio)
#### Post date: [July 1, 2021, 8:38am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/24 "2021-07-01T08:38:38Z")

</div>

isnt it the same query as the one in the tutorial code ? and Yes i tried it yesterday just to make sure that the query does return something , and it was giving the relevant candle data  
but then again why does it return empty array when its used inside of bitquery.js in the tutorial ?

---

<div class="post-metadata">

### Author: ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)
#### Post date: [July 1, 2021, 8:44am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/25 "2021-07-01T08:44:52Z")

</div>

Yes it’s the same query in the tutorial.

---

<div class="post-metadata">

### Author: ![Rio](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@Rio](https://community.bitquery.io/u/Rio)
#### Post date: [July 1, 2021, 8:57am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/26 "2021-07-01T08:57:08Z")

</div>

okay but any suggestion as to why it isnt working with the charts?

---

<div class="post-metadata">

### Author: ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)
#### Post date: [July 1, 2021, 9:05am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/27 "2021-07-01T09:05:19Z")

</div>

I just checked the API call and it seems that

```auto
const response2 = await axios.post(Bitquery.endpoint, {
                query: Bitquery.GET_COIN_BARS,
                variables: {
                    "from": new Date("2021-06-20T07:23:21.000Z").toISOString(),
                    "to": new Date("2021-06-23T15:23:21.000Z").toISOString(),
                    "interval": Number(resolution),
                    "tokenAddress": symbolInfo.ticker
                },
                mode: 'cors',
                headers: {
                    "Content-Type": "application/json",
                    "X-API-KEY": "YOUR UNIQUE API KEY"
                }
            })
           
  // Console logging the query result --> 
            console.log(response2.data.data.ethereum.dexTrades[0].high);
            
            const bars = response2.data.data.ethereum.dexTrades.map(el => ({
                time: new Date(el.timeInterval.minute).getTime(), // date string in api response
                low: el.low,
                high: el.high,
                open: Number(el.open),
                close: Number(el.close),
                volume: el.volume
            }))

```

the query does return the data from the API. You just need to console.log(); in order to check it if you want.

```auto
console.log(response2.data.data.ethereum.dexTrades[0].high);

```

---

<div class="post-metadata">

### Author: ![Rio](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@Rio](https://community.bitquery.io/u/Rio)
#### Post date: [July 1, 2021, 10:25am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/28 "2021-07-01T10:25:04Z")

</div>

I did , but i dont think its working :

 ![Screenshot_79](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/be8046c8f5dbe89048eb651dc45492e0626432b1.png)

it logs : Cannot read property ‘high’ of undefined

---

<div class="post-metadata">

### Author: ![OneClickCrypto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/oneclickcrypto/32/85_2.png) [@OneClickCrypto](https://community.bitquery.io/u/OneClickCrypto)
#### Post date: [July 3, 2021, 9:51pm UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/29 "2021-07-03T21:51:53Z")

</div>

I have the same problem. i install all and get the chart view. But the view is very smal.

But this is not the Problem. The Problem is that i have no idea where the chart show the candles. is also blank…

have anyone a solution?

 ![Screenshot 2021-07-03 at 17-45-10 Technical Charts Bitquery](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/9af1a6b1aa18b52f79a5290b0a8d9cd481221837.png)

---

<div class="post-metadata">

### Author: ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)
#### Post date: [July 6, 2021, 4:26am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/30 "2021-07-06T04:26:22Z")

</div>

dexTrades returns an array and hence to get a single value of a candlestick property, you might need to iterate over the array

---

<div class="post-metadata">

### Author: ![cryptoMav](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cryptoMav](https://community.bitquery.io/u/cryptoMav)
#### Post date: [July 28, 2021, 1:48pm UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/33 "2021-07-28T13:48:37Z")

</div>

Try removing the “tradeAmountUsd: {gt: 10}” from your query.

---

<div class="post-metadata">

### Author: ![cryptoMav](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cryptoMav](https://community.bitquery.io/u/cryptoMav)
#### Post date: [July 28, 2021, 1:49pm UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/34 "2021-07-28T13:49:47Z")

</div>

Any information on how to subscribe to bitQuery. I’ve been working on a project similar to this and I can’t get a live chart no matter what I’ve tried. Any information about this would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)
#### Post date: [July 28, 2021, 7:27pm UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/35 "2021-07-28T19:27:36Z")

</div>

Hi @cryptoMav you can refer to this tutorial as it is the updated one [Integrating Tradingview’s Technical Analysis Charts with Bitquery GraphQL API using VueJS](https://community.bitquery.io/t/integrating-tradingview-s-technical-analysis-charts-with-bitquery-graphql-api-using-vuejs/343)

---

<div class="post-metadata">

### Author: ![Ph-hitachi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/ph-hitachi/32/318_2.png) [@Ph-hitachi](https://community.bitquery.io/u/Ph-hitachi)
#### Post date: [November 14, 2021, 4:09pm UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/36 "2021-11-14T16:09:44Z")

</div>

in the 1m interval the candles looks bar how can we fix this?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/b6327640841d30eef392c4fd0b069041b3ac0bd1.png)

---

<div class="post-metadata">

### Author: ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)
#### Post date: [November 15, 2021, 5:43am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/38 "2021-11-15T05:43:43Z")

</div>

You can smoothen the data through a few filters like

`priceAsymmetry` - use something like `priceAsymmetry: {lteq: 20}`, this basically removes trades where both sides of USD price difference is more than 20 dollar.

`tradeAmountUsd` - use something link `tradeAmountUsd: {gteq: 1}`, this basically remove trades less than 1 dollar.

let me know how it worked.

---

<div class="post-metadata">

### Author: ![Ph-hitachi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/ph-hitachi/32/318_2.png) [@Ph-hitachi](https://community.bitquery.io/u/Ph-hitachi)
#### Post date: [November 15, 2021, 8:58am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/39 "2021-11-15T08:58:38Z")

</div>

i change the query like this it seems doesn’t work

 ![image](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/ac706d3a637672d9cf29529ff3e2f48ccf537c66.png)

---

<div class="post-metadata">

### Author: ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)
#### Post date: [November 15, 2021, 1:07pm UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/40 "2021-11-15T13:07:43Z")

</div>

This is correct, how you are comparing the charts? Which service you are using to compare our charts?

---

<div class="post-metadata">

### Author: ![Ph-hitachi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/ph-hitachi/32/318_2.png) [@Ph-hitachi](https://community.bitquery.io/u/Ph-hitachi)
#### Post date: [November 16, 2021, 3:16am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/41 "2021-11-16T03:16:00Z")

</div>

> [@gaurav](#):
>
> how you are comparing the charts?

Hi, Thanks for response i already solved my problem by changing timeInterval to 1min

```auto
 timeInterval {
      minute(count: 1, format: "%Y-%m-%dT%H:%M:%SZ")  
 }

```

but when i changing the chart to 5mins it will not load but it shows no error on console i think the problem is updating the chart, its hard it to me i can’t find any documentation about this

---

<div class="post-metadata">

### Author: ![hfhunter7](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@hfhunter7](https://community.bitquery.io/u/hfhunter7)
#### Post date: [November 26, 2021, 4:52am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/42 "2021-11-26T04:52:45Z")

</div>

@gaurav you can help me please my issue is getBars function call api infinite loop i cant resolve it

---

<div class="post-metadata">

### Author: ![sneha\_chopra](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sneha\_chopra](https://community.bitquery.io/u/sneha_chopra)
#### Post date: [December 4, 2021, 5:05am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/43 "2021-12-04T05:05:09Z")

</div>

Hi,  
Followed the document as mentioned above , but the thing is the charting library accessed from Github (from Trading-view) has errors. Can anyone who have come across with the same errors in charting.js file please help me out to solve .  
I will be attaching the screenshot of the errors mentioned

 ![error](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/27625b02e8432a2d04f63267a8db36318f1e9ef3.png)

---

<div class="post-metadata">

### Author: ![foonlen](https://avatars.discourse-cdn.com/v4/letter/f/4af34b/32.png) [@foonlen](https://community.bitquery.io/u/foonlen)
#### Post date: [December 16, 2021, 11:06am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/44 "2021-12-16T11:06:06Z")

</div>

Hello,

i am also getting the same, how to resolve this??

---

<div class="post-metadata">

### Author: ![foonlen](https://avatars.discourse-cdn.com/v4/letter/f/4af34b/32.png) [@foonlen](https://community.bitquery.io/u/foonlen)
#### Post date: [December 16, 2021, 11:10am UTC](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244/45 "2021-12-16T11:10:10Z")

</div>

![trading_view](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/7cfb4b8f367587f1fb2e1576a26ef896e2a37e55.png)

After integrating i am getting this error. Updated with new API key address, how to get resolved???

[Previous page](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244.md?page=1)

[Next page](https://community.bitquery.io/t/bitquery-api-integration-with-tradingview-technical-analysis-charts-dex-apis/244.md?page=3)
