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

ADX has a different value from TradingView #671

Open
NAYjY opened this issue Mar 28, 2023 · 3 comments
Open

ADX has a different value from TradingView #671

NAYjY opened this issue Mar 28, 2023 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@NAYjY
Copy link

NAYjY commented Mar 28, 2023

Which version are you running? The lastest version is on Github. Pip is for major releases.
0.3.14b0

Do you have TA Lib also installed in your environment?
Yes, I have.

Describe the bug
Some indicator provide some value not equal as TradingView
I know that this issue is not that new but I found the some of the solution
but still not sure if it's all. The cause of it is float number that is equal to each other.

To Reproduce
Example from adx.py

pos = ((up > dn) & (up > 0)) * up
neg = ((dn > up) & (dn > 0)) * dn

turn to

import numpy
pos = ((up > dn) & (up > 0) & (~numpy.isclose(up,dn))) * up
neg = ((dn > up) & (dn > 0) & (~numpy.isclose(up,dn))) * dn

Then things get fixed.

Expected behavior
Just wanna share in case you can dev and update it in next release.
I did't check all of it but ema also got this problem, still didn't look into it's detail.

if you saw it you can close this issue yourself. I'm still not quite use to with Github instead of look read and take. On going to be the one who can share too.

@NAYjY NAYjY added the bug Something isn't working label Mar 28, 2023
@twopirllc twopirllc removed their assignment Mar 28, 2023
@twopirllc twopirllc added duplicate This issue or pull request already exists and removed bug Something isn't working labels Mar 28, 2023
@twopirllc twopirllc changed the title Different value from TradingView ADX has a different value from TradingView Apr 12, 2023
@twopirllc
Copy link
Owner

Hello @NAYjY,

Interesting! ADX has had a recent upgrade #572 a few weeks ago on the development branch that needs external testing. Does your recommendation satisfy TV's version 5 of adx? If so, that would be awesome and a quick fix. Otherwise, adx need some additional tuning. 😐

Kind Regards,
KJ

@NAYjY
Copy link
Author

NAYjY commented Apr 13, 2023

Hello @NAYjY,

Interesting! ADX has had a recent upgrade #572 a few weeks ago on the development branch that needs external testing. Does your recommendation satisfy TV's version 5 of adx? If so, that would be awesome and a quick fix. Otherwise, adx need some additional tuning. 😐

Kind Regards, KJ

I've tested it out with both V5 and V4, and it's been working just fine. So, I don't think the pine version matters. I've been using this thing for a while now and haven't run into any problems. So for ADX values different from TV , it should fix the issue.

@niantonov
Copy link

Are there any updates on this? I encountered the same issue while calculating ADX. I am comparing it against R TTR package and its calculation of ADX seems to match TradingView and other platforms that report the same values.
@NAYjY your proposed fix did not change anything for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants