An updated version of TTR is now on CRAN. The biggest changes to be aware of are that all moving averages attempt to set colnames,
CCI() returns an object with colnames, and the initial gap for
SAR() is not hard-coded at 0.01. There are also some much-needed bug fixes - most notably to Yang Zhang volatility,
There are some exciting new features, including a rolling single-factor model function (
rollSFM(), based on a prototype from James Toll), a
runPercentRank() function from Charlie Friedemann,
WPR() return 0.5 instead of NaN when there’s insufficient price movement, and a faster
Here are all of the updates (from the CHANGES file):
#-#-#-#-#-#-#-#-#-# Changes in TTR version 0.22-0 #-#-#-#-#-#-#-#-#-#
SIGNIFICANT USER-VISIBLE CHANGES
CCI()now returns an object with colnames (“cci”).
- All moving average functions now attempt to set colnames.
- Added clarification on the displaced nature of
SAR()now sets the initial gap based on the standard deviation of the high-low range instead of hard-coding it at 0.01.
rollSFM()function that calculates alpha, beta, and R-squared for a single-factor model, thanks to James Toll for the prototype.
runPercentRank()function, thanks to Charlie Friedemann.
- Moved slowest portion of
include.lag = FALSEargument, which includes the current period’s data in the calculation. Setting it to
TRUEreplicates the original calculation. Thanks to Garrett See and John Bollinger.
- The Stochastic Oscillator and Williams’ %R now return 0.5 (instead of NaN) when a securities’ price doesn’t change over a sufficient period.
- All moving average functions gain
- Users can now change
alphain Yang Zhang volatility calculation.
maTypeis a list. Now
mavg.slow = maType[]and
mavg.fast = maType[], as users expected based on the order of the
nSlowarguments. Thanks to Phani Nukala and Jonathan Roy.
- Fixed bug in
lags()function, thanks to Michael Weylandt.
- Corrected error in Yang Zhang volatility calculation, thanks to several people for identifying this error.
- Correction to
SAR()extreme point calculations, thanks to Vamsi Galigutta.
adjRatios()now ensures all inputs are univariate, thanks to Garrett See.
nis less than the number of non-NA values, thanks to Roger Bos.
- Fix to
BBands()docs, thanks to Evelyn Mitchell.
If you love using my open-source work (e.g. quantmod, TTR, xts, IBrokers, microbenchmark, etc.), you can give back by sponsoring me on GitHub. I truly appreciate anything you’re willing and able to give!
I look forward to your questions and feedback! If you have a question, please ask on Stack Overflow and use the [r] and [ttr] tags. Or you can send an email to the R-SIG-Finance mailing list (you must subscribe to post). Open an issue on GitHub if you find a bug or want to request a feature. Please read the contributing guide first! It will help save time for both of us. ;-)