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

Average Directional Index seems to be slightly off #173

Closed
op1031 opened this issue Nov 11, 2020 · 5 comments · Fixed by #174
Closed

Average Directional Index seems to be slightly off #173

op1031 opened this issue Nov 11, 2020 · 5 comments · Fixed by #174
Assignees
Labels
bug Something isn't working

Comments

@op1031
Copy link

op1031 commented Nov 11, 2020

Hi Dave,

First, thank you for your contribution to this project. I am excited to find this time-saving project a couple of weeks ago.
The issue I am submitting has to do with Average Directional Index (ADX). I notice that it is somewhat off when I compare it with tradingview's ADX/DMI indicator.

For example, on 2000-11-27, the Skender ADX indicator shows
ADX=30.1245
+DI=16.898
-DI=30.579

On the same day, TradingView indicator shows
ADX=30.4113
+DI=16.9263
-DI=30.6871

Could you check if this is a bug?

Thank you,

@DaveSkender
Copy link
Owner

DaveSkender commented Nov 11, 2020

I’ll take a look. Are you able to confirm that the historical quote data used in both is the same? Some providers will adjust differently for splits and dividends, which would produce slightly different results. Also, make sure you are providing at least 250 points of quote history prior to the measured date in the GetAdx call. In your example, your history should start before January 2000. This algorithm uses a convergence method that increases in precision when more history is provided; if you only provided the minimum required history before that evaluation date, precision will be off a bit.

@DaveSkender DaveSkender added the bug Something isn't working label Nov 12, 2020
@DaveSkender DaveSkender self-assigned this Nov 12, 2020
@DaveSkender
Copy link
Owner

DaveSkender commented Nov 12, 2020

I did find a minor bug with the initialization value that only had small precision impacts on the initialization period values. This bug did not impact the accuracy of values after the initialization period. I also increased the minimum required history from 2×N+1 to 2×N+150 to ensure users are aware of the initialization period where values are less precise and that this indicator needs more runway. Thank you for reporting.

@DaveSkender
Copy link
Owner

This fix was implemented in v1.1.1

@op1031
Copy link
Author

op1031 commented Nov 12, 2020 via email

@github-actions
Copy link

This Issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new Issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants