Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check study unexpected error #240

Open
TimUnderhay opened this issue Apr 30, 2024 · 0 comments
Open

check study unexpected error #240

TimUnderhay opened this issue Apr 30, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@TimUnderhay
Copy link

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.

@TimUnderhay TimUnderhay added the bug Something isn't working label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants