Open rezaee opened 4 years ago
The class MAInput defined as:
class MAInput {
period: number;
values: number[];
}
You either need to change the prices variable name to "values" or explicitly pass the price array to "values" property:
doSMA(period, prices) {
console.log('sma result is:' , sma({period, values: prices}));
}
The class MAInput defined as:
class MAInput { period: number; values: number[]; }
You either need to change the prices variable name to "values" or explicitly pass the price array to "values" property:
doSMA(period, prices) { console.log('sma result is:' , sma({period, values: prices})); }
Thank you very much!
I want to use
technicalindicators
in my Angular app written in TypeScript, but don't know how to import and use it?What I want to do is calculating SMA(Simple Moving Averages) of an array.
EDIT:
I have installed
technicalindicators
module usingnpm i --save technicalindicators
command. Then I imported it like this:Then I tried to use it like this:
But I get this error message: