Skip to content

Retrieve chart pattern studies example missing #220

Open
@mac2000

Description

@mac2000

By chart patterns I mean this ones:

image

Restriction:

  • they are available only for paid plans
  • TradingView.searchIndicator somehow does not find them
  • from ws messages on trading view it seems that identifiers are something like BearishFlagCP@tv-chart_patterns-26 but attempt to retrieve it fails with error that indicator is undefined
  • also from indicator search in inspector I see that its data id attribute is BearishFlagCP@tv-chart_patterns
image image

How I tried to retrieve it:

import TradingView from '@mathieuc/tradingview';

var username = 'hello'
var password = 'world'

var user = await TradingView.loginUser(username, password, false)

var client = new TradingView.Client({
  signature: user.signature,
  token: user.token,
});
var chart = new client.Session.Chart();
chart.setMarket('NYSE:VOO');

var indicator = await TradingView.getIndicator('BearishFlagCP@tv-chart_patterns')

var study = new chart.Study(indicator)
console.log(`Retrieving ${indicator.description}`)
study.onUpdate(() => {
  console.log(`Retrieved ${indicator.description}`)
  console.log(study.periods)
})

Notes:

  • chart patterns are not usual pine scripts, not sure if thats relates at all because after end it is still study that is just being rendered
  • indicator is searchable even in anonymous session from web site, it just not works for non paid accounts

Wondering if I am missing something, willing to create one more example while have paid subscription, because I bed I am not a first one and not last one who is struggling with this

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions