thanhnguyennguyen / trading-indicator

provide trading technical indicator values based on data of almost crypto currency exchanges
https://www.npmjs.com/package/trading-indicator
241 stars 55 forks source link

TypeError: indicators.atr.calculate is not a function #60

Open sky00781 opened 10 months ago

sky00781 commented 10 months ago

hello,i just use the bellow code,the the error image

anything i missed? how can i fixed it.

my code is :

async function test(){ const { atr, getDetachSourceFromOHLCV } = require('trading-indicator') const { input } = await getDetachSourceFromOHLCV('binance', 'BTC/USDT', '1h', false) // true if you want to get future market console.log(input); let atrData = await atr(14, "close", input) console.log(atrData[atrData.length - 1]) }

(async function(){
// await ready() await test() })();