TradingView-API icon indicating copy to clipboard operation
TradingView-API copied to clipboard

Adding some sort of documentation

Open NicoloZorzetto opened this issue 4 years ago • 1 comments

Hello, I normally don't do this kind of thing, but you seem like a nice dev and your project is very cool.

I was wondering if you, or someone else, could make some sort of documentation.

I have never used any kind of javascript so I admit that I am part of the problem, but I can't even get to run one of the 'examples' scripts.

To my understanding I have to put some sort of private-key that I get from tradingview, but I have no clue where (I haven't seen it mentioned in the examples). Anyway, the script won't even get to display an output before spitting out an error that has something to do with '../main', but that's maybe a topic for another isse.

NicoloZorzetto avatar Jan 13 '22 00:01 NicoloZorzetto

Hello, yes I would like to make a markdown documentation using the current JSDoc documentation. That's why there is a "jsdoc-to-markdown" dependency in package.json. But currently when I try to convert the JSDoc into markdown, it says that my JSDoc isn't valid (while it is recognized by VSCode...). So I tried to @typedef every callback function and that works. But it would take a long time to @typedef ALL callback functions... Maybe there is another solution but the documentation of JSDoc isn't very complete...

To my understanding I have to put some sort of private-key that I get from tradingview, but I have no clue where (I haven't seen it mentioned in the examples).

You have to put your sessionid cookie. You can see it in examples/AllPrivateIndicators.js :

const client = new TradingView.Client({
  /* Token is only needed if at least one indicator is
    PRIVATE (if you have a paid TradingView account) */
  token: 'YOUR_SESSION_ID_COOKIE',
});

Mathieu2301 avatar Jan 14 '22 17:01 Mathieu2301