Skip to content

Get error when run MultipleSyncFetch.js: "The maximum number of studies per chart has been reached for current subscription" #269

@huynhduc96

Description

@huynhduc96

Describe the bug

Basically I'm re-running the functions in MultipleSyncFetch.js but getting the error:
The maximum number of studies per chart has been reached for current subscription

run this file continuously
about 3-5 times continuously will appear the above error.

To Reproduce

here is my code :

const TradingView = require("@mathieuc/tradingview");

/**
 * This examples synchronously fetches data from 3 indicators
 */

const client = new TradingView.Client();
const chart = new client.Session.Chart();
chart.setMarket('BINANCE:DOTUSDT');

function getIndicData(indicator) {
  return new Promise((res) => {
    const STD = new chart.Study(indicator);

    console.log(`Getting "${indicator.description}"...`);

    STD.onUpdate(() => {
      res(STD.periods);
      console.log(`"${indicator.description}" done !`);
    });
  });
}

(async () => {
  console.log('Getting all indicators...');

  const indicData = await Promise.all([
    await TradingView.getIndicator('PUB;3lEKXjKWycY5fFZRYYujEy8fxzRRUyF3'),
    await TradingView.getIndicator('PUB;5nawr3gCESvSHQfOhrLPqQqT4zM23w3X'),
    await TradingView.getIndicator('PUB;vrOJcNRPULteowIsuP6iHn3GIxBJdXwT'),
  ].map(getIndicData));

  console.log(indicData);
  console.log('All done !');

  client.end();
})();

Expected behavior

can run normally

Screenshots

1

Full Test :

full-gif

Environment:

  • OS: MacOs
  • Node version: v23.3.0

Additional context

run this file continuously about 3-5 times continuously will appear the above error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions