-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Fixed Minor Bugs inside the MA-functions #131
Conversation
The following MA-functions didn't add a column name as the SMA-function does: HMA ALMA WMA EVWMA The WMA were missing a reclass before the if-statement, and were therefore giving dim = NULL, which also affected the HMA. By fixing WMA, the ALMA and HMA got fixed as a by product by also adding an if-statement similar to the rest of the MA functions. The EVWMA function were wissing a reclass before the if-statement, so it never got evaluated inside the if-statement.
Thanks for the report and patch! |
while i generally agree w/ this, just want to note that it is a breaking change and warrants a prominent callout. |
Great point about it being a breaking change. I don't have strong feelings about colnames for ROC() and momentum(). But I do think indicators should set column names. Currently at least one doesn't: |
not sure i get the diff between the types of calculations ;) def in the realm of a lot of work for not a so much benefit, as anyone who cares about this is prolly already handling it themselves |
I'm also generally in favor of setting column names. A breaking change would be the change in the convention for setting column names, as some users might rely on the present convention for |
i think basic xts (not sure where in the stack this is actually implemented) functionality will carry forward the existing column name unless you override it. so |
All built-in data now only has the datasets keyword argument, which comes by default. The chart_ma()-function has been rewritten to mitigate possible bugs. See for example joshuaulrich/TTR#131. The error is fixed, but its not published to CRAN yet. The new approach is robust against such bug-fixes for univariate series. All moving average (MA) functions have been redocumented for usage and title sections.
All built-in data now only has the datasets keyword argument, which comes by default. The chart_ma()-function has been rewritten to mitigate possible bugs. See for example joshuaulrich/TTR#131. The error is fixed, but its not published to CRAN yet. The new approach is robust against such bug-fixes for univariate series. All moving average (MA) functions have been redocumented for usage and title sections.
Hi @joshuaulrich,
This is a somewhat trivial
PR
, I noticed a minor bug in some of yourMA
-functions which resulted in unexpected behavior; some of theMA
-functions didn't add column names as expected. This is my attempt to fix it.Here is my formatted commit-message:
The following
MA
-functions didn't add a column name as theSMA
-function does:HMA
ALMA
WMA
EVWMA
The
WMA
were missing a reclass before the if-statement, and were therefore giving dim = NULL, which also affected theHMA
. By fixingWMA
, theALMA
andHMA
got fixed as a by product by also adding an if-statement similar to the rest of theMA
functions. TheEVWMA
function were wissing a reclass before the if-statement, so it never got evaluated inside the if-statement.Please review the contributing guide before submitting your pull request. Please pay special attention to the pull request and commit message sections. Thanks for your contribution and interest in the project!