Can someone help me with using the technicalindicators
library in my Angular app? I'm working in TypeScript and need to know how to import and utilize it properly.
Specifically, I am trying to calculate Simple Moving Averages (SMA) of an array.
UPDATE:
After installing the technicalindicators
module using the command npm i --save technicalindicators
, I imported it as follows:
import {sma} from 'technicalindicators';
Then I attempted to use it like this:
var prices = [1,2,3,4,5,6,7,8,9,10,12,13,15];
var period = 10;
doSMA(period , prices){
console.log('sma result is:' , sma({period, prices}));
}
However, I encountered the following error message:
Argument of type '{ period: any; prices: any; }' is not assignable to parameter of type 'MAInput'