Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stochastic RSI cannot be negative #113

Open
bennycode opened this issue Nov 29, 2021 · 1 comment
Open

Stochastic RSI cannot be negative #113

bennycode opened this issue Nov 29, 2021 · 1 comment

Comments

@bennycode
Copy link

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 show 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"?

@codeplea
Copy link
Member

This seems to be an error with the website documentation. Thanks for letting me know. I'll make sure it gets fixed on the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants