title: getBars getting called recursively infinite times in the JS API for trading view charting_library
body: <p>I am fairly new to the Trading View's charting library. I have my own custom Datafeed that I want t integrate it with. However, while implementing the JS API for it, the <strong>getBars</strong> method is being called recursively infinite times for some reason.</p>
  <p>Here's my code of JS API:</p>
  <p><strong>getBars:</strong></p>
  <pre><code>getBars: (symbolInfo, resolution, from=1611030900, to=1611030960, onHistoryCallback, onErrorCallback, firstDataRequest) =&gt; {
      fetch('../BT_Data.json')
      .then(response =&gt; response.json())
      .then(btData =&gt; {
          let bars = [];
  
          btData.forEach(tuple =&gt; {
              let timestamp = new Date(tuple.Timestamp);
              let time = Math.floor(timestamp.getTime() / 1000); // Converting it to UNIX timestamp
  
              bars = [...bars, {
                  time: time,
                  low: tuple.l,
                  high: tuple.h,
                  open: tuple.o,
                  close: tuple.c,
                  volume: tuple.v 
              }]
           })
           onHistoryCallback(bars, { noData: false });
      })
      .catch(error =&gt; console.log(error));
  </code></pre>