Skip to content

check study unexpected error #240

Open

Description

@TimUnderhay

Describe the bug
When attempting to study a builtin indicator (DEMA), the client errors with check study unexpected error. I'm sure the issue is something I've done wrong, but I've attempted to follow the examples and read the jsDocs, but the error isn't enough to go on.

To Reproduce

const client = new TradingView.Client({
  token: 'sometoken',
  signature: 'somesignature'
});
const chart = new client.Session.Chart();
chart.setMarket(
  'BINANCE:BTCUSDT',
  {
    timeframe: '5',
    range: 100
  }
);
const demaProfile = new TradingView.BuiltInIndicator('STD;DEMA');

// I've tried with and without these options:
demaProfile.setOption('pineFeatures', '{"indicator":1,"plot":1,"ta":1}');
demaProfile.setOption('in_0', 63); // length
demaProfile.setOption('in_1', 'close'); // source
demaProfile.setOption('in_2', ''); // timeframe
demaProfile.setOption('in_3', true); // Wait for timeframe closes
demaProfile.setOption('__profile', false);

const study = new chart.Study(demaProfile)
study.onUpdate(
  () => {
    console.log(
      util.inspect(study.graphic, { showHidden: true, depth: Infinity, colors: true, showProxy: true })
    )
    client.end();
  }
);
// prints "check study unexpected error"

Expected behavior
Expect no error

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • OS: Ubuntu 24
  • Node version: 22.0

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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