The code throws an exception when I create a study object with a invite-only indicator
The error says: study_not_auth:Script@tv-scripting-417 undefined
I installed the tradingview-api
npm i github:Mathieu2301/TradingView-API
Here is my code:
var TradingView = require("@mathieuc/tradingview")
console.log(TradingView.version);
TradingView.loginUser("<USERNAME>", "<PASSWORD>", false).then((user) => {
const client = new TradingView.Client();
// Find indicators
TradingView.searchIndicator('-- UCTS').then((rs) => {
for(let i in rs) {
console.log('Found Indicators:', rs[i]);
}
});
const chart = new client.Session.Chart();
chart.setMarket('BINANCE:BTCUSDT', {
timeframe: '60',
currency: 'USD',
});
TradingView.getIndicator('PUB;ryMeUolWwdyo9F3MNleMvPPmoSDpGY4n').then(async (indic) => {
console.log(`Loading '${indic.description}' study...`);
const study = new chart.Study(indic);
});
}).catch((err) => {
console.error('Login error:', err.message);
});
The code throws an exception when I create a study object with a invite-only indicator The error says: study_not_auth:Script@tv-scripting-417 undefined
I installed the tradingview-api
npm i github:Mathieu2301/TradingView-API
Here is my code:
The output says:
Environment:
Additional context: I am authorized for this script and it works in the Browser. I tried to load but public IDs but they both fail.