Skip to content

Stochastic RSI cannot be negative #113

Open
@bennycode

Description

@bennycode

Hi @codeplea, I have checked your Stochastic RSI implementation and was wondering why it becomes negative (-0.54) at the end of your "Example Calculation"? From what I have read on Investopedia the Stochastic RSI ranges only between 0 and 1: https://www.investopedia.com/terms/s/stochrsi.asp

Your tests actually shows the same by expecting 0.000 at the end:

stochrsi 5
{81.59,81.06,82.87,83.00,83.61,83.15,82.84,83.99,84.55,84.36,85.53,86.54,86.89,87.77,87.29}
{0.658,1.000,1.000,1.000,1.000,0.000}

So how come your website lists "-0.54"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions