joshuaulrich / TTR

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

New signal-to-noise ratio for prices #26

Closed peterccarl closed 8 years ago

peterccarl commented 8 years ago

Here's a function for examining trendiness over a timeframe using ATR as a proxy for volatility. I think this fits the package, but let me know if you think it goes elsewhere. pcc

braverock commented 8 years ago

This may reopen the conversation about moving the OHLC functionality 'upstream' from quantmod to TTR.

This pull request can't be merged as is, because quantmod requires TTR, so this creates a circular dependency.

Also, CRAN only wants you to check and require another package if that package is in Suggests. otherwise they want you to have either put it in Requires or Imports

peterccarl commented 8 years ago

Sorry, I'll remove those lines since they are unnecessary if the function is in ttr. Good catch.

postscript: just to be clear, this shouldn't reopen the conversation about OHLC functionality...

On Apr 7, 2016 6:59 AM, "Brian G. Peterson" notifications@github.com wrote:

This may reopen the conversation about moving the OHLC functionality 'upstream' from quantmod to TTR.

This pull request can't be merged as is, because quantmod requires TTR, so this creates a circular dependency.

Also, CRAN only wants you to check and require another package if that package is in Suggests. otherwise they want you to have either put it in Requires or Imports

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/joshuaulrich/TTR/pull/26#issuecomment-206834816

joshuaulrich commented 8 years ago

Some other items:

  1. ... are not passed to ATR as documented.
  2. The try.xts / reclass paradigm should be used so all time series classes will be supported. See other functions for examples.
  3. lag.xts should be called explicitly in case try.xts fails and HLC is a matrix.
peterccarl commented 8 years ago

Fixed, thanks for the pointers.

joshuaulrich commented 8 years ago

reclass isn't called before return and quantmod::Cl still creates a circular dependency.

peterccarl commented 8 years ago

Ok, I missed the real circularity you were referring to. I've removed it.

joshuaulrich commented 8 years ago

Merged via 990da831c44785fb3043936597cc0fae4cd42444.