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

relative_strength_index calculation is not correct; there is huge difference with actual RSI #30

Open
msarm opened this issue Mar 18, 2020 · 2 comments

Comments

@msarm
Copy link

msarm commented Mar 18, 2020

relative_strength_index calculation is not correct; there is huge difference with actual RSI

@whiteking64
Copy link

These 2 lines below are inaccurate: the variables gains and losses should be 0 or positive, but they can return negative values.

gains = [0 if filtered_gain[idx] is True else changes[idx] for idx in range(0, len(filtered_gain))]

losses = [0 if filtered_loss[idx] is True else abs(changes[idx]) for idx in range(0, len(filtered_loss))]

Removing is True or substituting it with == True in the for loop work. (though I don't know why..)

@msarm
Copy link
Author

msarm commented Apr 11, 2020

it works now. Need to run with different samples.

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