anandanand84 / technicalindicators

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

KST Error: FixedSizeLinkedList: Size required and should be a number. #203

Open jaggedsoft opened 4 years ago

jaggedsoft commented 4 years ago

I'm getting an error when using Know Sure Thing, and all the input data appears to be correct.

https://github.com/anandanand84/technicalindicators/blob/066f35bcffbf9f923f45ec28525d1f2a5d063a76/src/Utils/FixedSizeLinkedList.ts#L16

UnhandledPromiseRejectionWarning: Size required and should be a number.

Thank you for your awesome library!

jaggedsoft commented 4 years ago
(node:5376) UnhandledPromiseRejectionWarning: Error: Size required and should be a number.
    at new FixedSizeLinkedList (dist/index.js:168:19)
    at dist/index.js:1492:37
    at Generator.next (<anonymous>)
    at new Stochastic (dist/index.js:1519:24)
    at Function.stochastic [as calculate] (dist/index.js:1541:20)
    at Client.<anonymous> (bot.js:1106:37)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:5376) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5376) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ericauv commented 3 years ago

This looks like it causes issues with anything that relies on FixedSizeLinkedList. (e.g. StochasticRSI, which relies on Stochastic) 😔