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

Directional Movement Index (DMI) not included in ADX output #403

Open
carusyte opened this issue Oct 10, 2024 · 1 comment
Open

Directional Movement Index (DMI) not included in ADX output #403

carusyte opened this issue Oct 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@carusyte
Copy link

What happened?

In https://python.stockindicators.dev/indicators/#content the URL link for Directional Movement Index (DMI) is acrtually pointing to https://python.stockindicators.dev/indicators/Adx/#content

Code usage

No response

Log output

No response

@DaveSkender
Copy link
Member

DaveSkender commented Oct 11, 2024

The Directional Movement Index plus/minus components are included as a component of Average Directional Movement Index (ADX), and are part of the same indicator, which is why the links points to the same page and not really a bug.

image

On inspection, I can see DMI (shown as dx below) is calculated as part of ADX, but am unsure as to why I didn't add it to the output result. You can calculate this yourself from the ADX output as a workaround. I'm converting this to an enhancement in the backlog, to add DMI to the output result.

https://github.com/DaveSkender/Stock.Indicators/blob/7c362fffed60a274058f2ed28259b9f73cae347a/src/a-d/Adx/Adx.Series.cs#L110-L114

// underlying C# source code

double dx = (pdi == mdi) ? 0 
  : (pdi + mdi != 0)
    ? 100 * Math.Abs(pdi - mdi) / (pdi + mdi)
    : double.NaN;

Fix depends on:

@DaveSkender DaveSkender added enhancement New feature or request and removed bug Something isn't working labels Oct 11, 2024
@DaveSkender DaveSkender moved this from 💡 Triage to 🔖 Do next in Stock Indicators for Python Oct 11, 2024
@DaveSkender DaveSkender changed the title The link for "Directional Movement Index (DMI)" in indicators doc page is incorrectly pointing to ADX Directional Movement Index (DMI) not included in ADX output Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔖 Do next
Development

No branches or pull requests

2 participants