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

natr behaves the same as atr(percent=True) #768

Open
wayne5ning opened this issue Feb 17, 2024 · 0 comments
Open

natr behaves the same as atr(percent=True) #768

wayne5ning opened this issue Feb 17, 2024 · 0 comments
Labels
enhancement New feature or request info Informational

Comments

@wayne5ning
Copy link

wayne5ning commented Feb 17, 2024

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

import pandas_ta as ta
print(ta.version) # 0.3.14b0

Do you have TA Lib also installed in your environment?

$ pip list
...
ta-lib                    0.4.28                   pypi_0    pypi
...

Have you tried the development version? Did it resolve the issue?

$ pip install -U git+https://github.com/twopirllc/pandas-ta.git@development

Same issue in dev.

Describe the bug
There are 2 ways to normalize ATR, namely normalizing before averaging and normalizing after averaging. ref https://www.macroption.com/normalized-atr/.

By reviewing the code, both natr and atr(percent=True) results in normalizing after averaging.

To Reproduce
cmp_pandas_ta_natr_atrp.ipynb.zip

Expected behavior
It may be better to have atr(percent=True) to normalize after averaging and natr to normalize before averaging. Or else there is a duplication of implementation, one of them should be removed to remove confusion.

@wayne5ning wayne5ning added the bug Something isn't working label Feb 17, 2024
@twopirllc twopirllc removed their assignment Feb 20, 2024
@twopirllc twopirllc added enhancement New feature or request info Informational and removed bug Something isn't working labels Feb 20, 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 info Informational
Projects
None yet
Development

No branches or pull requests

2 participants