Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
TradingView getBars JS API issue when calling onHistoryCallback (nuxtJS vueJS)

I am trying to create JS API for making trading view calls to the server It works fine for config & resolveSymbol but I've problem in getBars

these are my javascript codes for getBars

        getBars: (symbolInfo, resolution, periodParams, onHistoryCallback, onErrorCallback, firstDataRequest) => {
          this.$axios.$get
          (this.datafeedUrl + '/history?symbol=' +
            symbolInfo.name +
            '&resolution=' + resolution +
            '&from=' + periodParams.from +
            '&to=' + periodParams.to +
            '&countback=20')
            .then((r) => {
              let bars = [];
              for (let i = 0; i < r.t.length; ++i) {
                let bar = {
                  time: 1e3 * r.t[i],
                  close: parseFloat(r.c[i]),
                  open: parseFloat(r.o[i]),
                  high: parseFloat(r.h[i]),
                  low: parseFloat(r.l[i]),
                  volume: parseFloat(r.v[i])
                }
                bars.push(bar)
              }
              console.log(typeof bars)
              console.log(bars)
              onHistoryCallback(bars, {noData: false})
            })
          onErrorCallback((e) => console.log(e))
        },

This is errors I get + console.log data error tradingview

my data format is exactly like udf(predefined JS API) of tradingview I can't get why this happens

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!