anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.13k stars 550 forks source link

SMA returns NaN #242

Closed vandat1995 closed 3 years ago

vandat1995 commented 3 years ago

Hi there, I'm using

const SMA = require('technicalindicators').SMA; var results = SMA.calculate(input); But results return NaN; Please help me! Thanks

with input ; { period: 2, values: [ '31568.07', '32255.56', '34687.71', '34487.22', '35911.26', '35031.39', '33489.96', '33760.94', '34652.94', '35280.16', '33672.72', '34206.01', '33845.64', '32852.04', '33805.01', '33497.98', '34253.81', '33070.87', '32709.09', '32464.46' ] }

results: [ NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN ]

vandat1995 commented 3 years ago

close my issue, I have not parse input value to number