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

MFI、STOCHRSI are not correct in some cases #567

Open
Caleblgx opened this issue Dec 2, 2022 · 2 comments
Open

MFI、STOCHRSI are not correct in some cases #567

Caleblgx opened this issue Dec 2, 2022 · 2 comments

Comments

@Caleblgx
Copy link

Caleblgx commented Dec 2, 2022

An interesting phenomenon in Python:
image
Code of MFI:
image
The problem is if tempValue1 = (2.86 + 2.7 + 2.73), prevValue = (2.81 + 2.7 + 2.78), which means tempValue2 not equal to 0(a small number instead due to the machine error), tempValue2 > 0. Obviously, the result is not what we want and far from the correct result.
I have some advice and I don't know whether they make sense in all case.

  1. tempValue2 keep 8(or 10 whatever) decimal places.
  2. do some change in if statement: bigger/small than a number closes to 0 (just like TA_IS_ZERO)

The other problem is STOCHRSI:
image
The five numbers in the window are supposed to be same, but unfortunately they are not due to the machine error(I guess). Again, the result is far from the correct result.
I think we can drop some accuracy to avoid machine error which can make result far away away from the correct result.

Thank you very much for answering in advance !

@Caleblgx Caleblgx changed the title MFI is MFI is not correct in Dec 2, 2022
@Caleblgx Caleblgx changed the title MFI is not correct in MFI is not correct in some cases Dec 2, 2022
@Caleblgx Caleblgx changed the title MFI is not correct in some cases MFI、STOCHRSI are not correct in some cases Dec 2, 2022
@trufanov-nok
Copy link
Contributor

It might be a bug. There was similar problem with near 0 values in CCI: https://sourceforge.net/p/ta-lib/bugs/107/

@mrjbq7
Copy link
Collaborator

mrjbq7 commented Dec 6, 2022

This will be something to fix right away when we take over TA-Lib C library maintenance.

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

3 participants