Skip to content

Method StatisticFunctions::stdev returns wrong results when small numbers are provided #1

@silencersm

Description

@silencersm

Hello Lupe and thanks for this awesome TA-Lib.
I was experimenting using it and noticed that the Trader::bbands method was returning wrong results when supplied with relatively small numbers. I am using binance data so for example the figures will be of the form "0.00004300".
I have looked into it and it seems that the C implementation is suffering from the same issue.
I noticed that it works correct by commenting out the if statement code in the lines below in the links so only code in lines 493 and 502 will be executed respectively.

if (!($tempReal < 0.00000001)) {

if (!($tempReal < 0.00000001)) {

I have attached a screenshot of the commented code.
screenshot from 2018-08-06 23-05-24

I was wondering if you could test that and provide a fix
Thanks again for you time and I am happy to contact me for any further clarification needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions