joshuaulrich / TTR

Technical analysis and other functions to construct technical trading rules with R
GNU General Public License v2.0
325 stars 102 forks source link

refactor TR calcs into a discrete function #124

Closed ethanbsmith closed 1 year ago

ethanbsmith commented 1 year ago

refactored th, tl, tr calculations into its own reusable function simplified ATR to call TR for underlying calculations, then pass to the averaging function have kept output names and orders as close to existing functionality as possible. ATR output is identical to prior version

closes #114

joshuaulrich commented 1 year ago

Looking good. I ran roxygen and noticed that we need to add #' @rdname ATR above the first line of both the ATR and TR functions.

For example:

#' @rdname ATR
"TR" <- function(...

#' @rdname ATR
"ATR" <- function(...
joshuaulrich commented 1 year ago

One typo

#' @rdname TR
"TR" <-

It should be #' @rdname ATR over both TR and ATR. That way they'll both be documented on the same page (ATR), since they're similar and share parameters.

ethanbsmith commented 1 year ago

done. sorry, not that familiar with the roxygen syntax. ill brush up on that

joshuaulrich commented 1 year ago

No worries about the roxygen syntax. I had to look it up.

Thanks for the suggestion and PR!