Changelog
Source:NEWS.md
Changes in 0.24.4
CRAN release: 2023-11-28
- Added Ethan B. Smith as a contributor. Thanks Ethan!
BUG FIXES
Fix
stockSymbols()for ticker “NA”.read.table()converts the string “NA” to a missing value (NA) becausena.strings = "NA"by default. This causes an issue because there’s actually a company with “NA” for the ticker. (#128)CTI()did not pad its result with leading NA when the input was not coerced to an xts object. This was different from other TTR functions (e.g.SMA(),RSI(),ROC()). (#127)Removed the
VMA()function, which was never correct because the results made no sense.Check that the
wma()C function has enough non-NA values and throw an error if it doesn’t. This could cause theWMA()function to crash the user’s R session. (#126)runMean(..., cumulative = TRUE)didn’t account for leading NA in the denominator. (#122)runSD(x, cumulative = TRUE)returned all NA whenxhad any leading NA. Thanks to Ethan B. Smith for the report. (#121)The
TRIX()signal line did not usenSigunlessmaTypewas provided. Thanks to @SatoshiReport for the… report. (#120)
MISCELLANEOUS
- Use symbols for native routine entry points to make them explicit and unable to be found accidentally. (#123)
Changes in 0.24.3
CRAN release: 2021-12-12
NEW FEATURES
- Added Keltner Channels. Thanks to Nick Procyk for the patch and docs (#106)
BUG FIXES
runPercentRank()would segfault ifxhad fewer non-NA observations than the value forn. Thanks to Ian Fellows for the report. (#112)run*(x, n = 1, cumulative = TRUE)functions would return NA for the first value. Thanks to Ethan B. Smith for the report and PR! (#111, #108, #88)Fix NA check off-by-one error in
aroon()that caused it to fail if there were exactly enough non-NA values. (#102)
Changes in 0.24.2
CRAN release: 2020-09-01
BUG FIXES
- Check for
ratio > 0before calculatingninzlema()C code. The prior code could result in division by 0, which was flagged by clang-UBSAN. Thanks to Prof Brian Ripley for the report. (#100)
Changes in 0.24.1
CRAN release: 2020-08-28
BUG FIXES
Fix leading NA accounting in
wma()C code. The prior code caused invalid reads under valgrind. Thanks to Prof Brian Ripley for the report. (#99)Check for
ratio > 0before calculatingnn ema()C code. The prior code could result in division by 0, which was flagged by UBSAN. Thanks to Prof Brian Ripley for the report. (#100)Make
ALMA()output length equal input length when the input can not be converted to xts. This was caused by the difference betweenrollapply.default()androllapply.xts(). Thanks to GitHub user @marksimmonds for the report. (#29)Fix
stoch()in very rare cases wherefastK = Inf. I could only reproduce this if the Close is > High and High and Low are equal, but that is a data error. I fixed anyway because there may be other cases I don’t anticipate. Thanks to GitHub user @cjuncosa for the report. (#52)-
Fix
MFI()when money flow is always zero or positive. The denominator of the money ratio will be zero if there is no negative money flow fornconsecutive observations (e.g. during a strong up-trend), which causes the money flow index to be Inf. Set the money flow index to 100 in this case.And the money ratio will be NaN if there’s no money flow for
nconsecutive observations (e.g. if there are no trades), which causes the money flow index to be NaN. Set the money flow index to 50 in this case.Thanks to GitHub user @jgehw for the report, reproducible example, and suggested patch. (#81)
Changes in 0.24.0
CRAN release: 2020-08-10
SIGNIFICANT USER-VISIBLE CHANGES
Updated
stockSymbols()to use the NASDAQ FTP site instead of downloading the CSV from the NASDAQ stock screener page. Some columns are no longer populated because they are not provided in the FTP file: LastSale ,MarketCap, IPOyear, Sector, Industry These columns will be removed in a future version. (#98, #5, #97)runPercentRank(x, n, cumulative = TRUE)now sets observations in the initialization period to NA. This is consistent with the other running/rolling functions in TTR. If you want the previous behavior, you should userunPercentRank(x, n = 1, cumulative = TRUE). Thanks to GitHub user @httassadar for the report. (#73)
NEW FEATURES
- Add Ehler’s Correlation Trend Indicator. Thanks to Evelyn Mitchell for the suggestion, and for Ethan B. Smith for the initial implementation. (#92)
BUG FIXES
runMAD()returned incorrect values whencumulative = TRUEand the input contained leading NA. Thanks to GitHub user @stellathecat for the report. This also affectedrunMedian(). (#93)ZLEMA()would crash whenratio = 0.0andnwas not specified. Thanks to GitHub user @yogat3ch for the report! (#95)WMA()did not return an xts object when passed an xts object forxthat had leading NA, with the defaultwts = 1:n. Thanks to Cory Fletcher for reporting this issue via email. (#96)stoch()was wrong whenbounded = FALSE. Thanks to GitHub user @rfinfun for the report and patch. (#74)HMA()threw an error whennwas an odd number. This was because the first call toWMA()usedn = n / 2which causednto not be an integer. Thanks to GitHub user @dragie for the report. (#76)
Changes in 0.23.0
SIGNIFICANT USER-VISIBLE CHANGES
Update
DVI()to userunPercentRank(). Thanks to Ivan Popivanov for the patch.getYahooData()now returns an xts object with Date index (not POSIXct).Column names for moving average function outputs are no longer based on the input column names.
BUG FIXES
run*()functions now error if there are not enough non-NA values.Change all instances of
lag()tolag.xts()in casexis a matrix. Thanks to Ivan Popivanov for the report.Correct output column names in
ATR()docs.CLV()now sets NaN and Inf values to 0, instead of only NaN values.Fix
OBV()soOBV[t] = OBV[t-1]whenClose[t] == Close[t-1].Fix dead links in documentation.
Changes in 0.22.0
NEW FEATURES
Added
rollSFM()function that calculates alpha, beta, and R-squared for a single-factor model. Thanks to James Toll for the prototype.Added
runPercentRank()function. Thanks to Charlie Friedemann.Moved slowest portion of
aroon()to C.DonchianChannel()gains aninclude.lag = FALSEargument, which includes the current period’s data in the calculation. Setting it toTRUEreplicates 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 alpha in Yang Zhang volatility calculation.
BUG FIXES
Fixed
MACD()whenmaTypeis a list. Nowmavg.slow = maType[[2]]andmavg.fast = maType[[1]], as users expected based on the order of thenFastandnSlowarguments. Thanks to Phani Nukala and Jonathan Roy.Fixed bug in
lags(). 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.EMA()andEVWMA()now ensurenis less than the number of non-NA values. Thanks to Roger Bos.Fix to
BBands()docs. Thanks to Evelyn Mitchell.
Changes in 0.21.1
BUG FIXES
Fixed
stockSymbols()for nasdaq.com changes (again), and attempted to makestockSymbols()more robust to nasdaq.com changes.Corrected final calculation in Yang-Zhang volatility. Thanks to Shal Patel.
Corrected
kin Yang-Zhang volatility. Thanks to Ian Rayner.Corrected
s2oands2cin Yang-Zhang volatility. Thanks to Ian Rayner.Corrected
KST()when input is xts (result is now * 100). Thanks to Yuanwei.
Changes in 0.21.0
BUG FIXES
Changed
wilderSum()to seed initial value with raw sum. This matches Wilder’s original calculations. Thanks to Mahesh Bp for the report.The
BBands()standard deviation calculation now uses the population instead of sample statistic. This is consistent with Bollinger Band literature. Thanks to Jeff Ryan for the patch.Fixed
stockSymbols()for nasdaq.com changes.Fixed
ZLEMA()default ratio by changing it from2/(n-1)to2/(n+1). This makes it consistent withEMA(). Thanks to Dirk Eddelbuettel.Corrected close-to-close volatility. Thanks to James Toll for the report.
adjRatios()failed (spectacularly) if there were missing close prices. Thanks to Garrett See for the report.
Changes in 0.20.2
NEW FEATURES
Added v-factor generalization to
DEMA(). Thanks to John Gavin.Updated
volatility()to handle univariate case ofcalc = "close". Thanks to Cedrick Johnson.Moved
EMA(),SAR(), andwilderSum ()from .Fortran to.Call ()and usedxts:::naCheck()instead of TTR’s NA check mechanism.RSI ()up/down momentum is now faster with xts. Thanks to Jeff Ryan.If
ratiois specified inEMA ()butnis missing, the traditional value ofnis approximated and returned as the first non-NA value.
Changes in 0.20.1
NEW FEATURES
- Updated
CMO(),DPO(),DonchianChannel(),RSI(), andTDI ()to explicitly use xts internally.
Changes in 0.20.0
- Fixed version number; 0.20-0 is now > 0.14-0 (rookie mistake).
SIGNIFICANT USER-VISIBLE CHANGES
getYahooData()now returns an xts object.Added column names to output for
ADX(),EMV(), andCLV ()(for xts).momentum()inCMO()no longer setsna = 100.Replaced
naargument inmomentum()andROC()withna.pad.-
Moved
maTypeargument default values from function formals to function body for the following functions:
NEW FEATURES
adjRatios()creates split and/or dividend adjustment ratio series via C code.GMMA()calculates the Guppy Multiple Moving Average.volatility()now has Yang Zhang, and Garman-Klass (Yang Zhang) calculations.-
The functions below now have cumulative argument. This allows the calculation of “from inception” running series.
Added internal smoothing to
FastKinstoch()viasmoothargument. Thanks to Stanley Neo.getYahooData()now usesadjRatios(),which yields significant speed improvements for larger data sets.All functions now use xts internally, adding support for all major time series classes. If
try.xts()fails on the input object(s), they will be converted to a matrix and a matrix object will be returned.Added
boundedarg tostoch()andSMI(), which includes the current period in the calculation.Added the zig zag indicator:
ZigZag().-
Added volatility estimators/indicators:
volatility(), with the following calculations:- Close-to-Close
- Garman Klass
- Parkinson
- Rogers Satchell
Added Money Flow Index:
MFI().Added Donchian channel:
DonchianChannel().Added
multipleargument toTDI(), allowing more user control.Added
naCheck()and implemented it in the moving average functions.
BUG FIXES
Fixed bug when
maTypewas a list andnwas not specified inmaType. This affected:stoch(),SMI(),RSI(),KST(),MACD(),TRIX().Corrected NaN replacement in
CLV().Corrected
williamsAD(): the result is 0 if C(t) = C(t-1).Corrected
runMedian()andrunMAD(). The argument controlling which type of median to calculate for even-numbered samples wasn’t being passed to the Fortran routine.aroon()calculation starts at periodn+1, instead ofn.Added NA to first element of
closeLagofATR().Corrected
BBands()andCCI()forrowMeans()use on xts objects.Made changes to Rd files to pass R CMD check on R-devel (2.9.0).
Changes in 0.14.0
SIGNIFICANT USER-VISIBLE CHANGES
Changed default
typeofROC()tocontinuous.Changed
BBands()%B output value frompct.btopctB.Changed
WPR()output value frompct.RtopctR.Changed
WPR()MA output value fromma.emvtoemvMA.Changed
aroon()output values fromaroon.xxtoaroonXx.-
Renamed:
-
chaikinMF()toCMF() -
stochastic()tostoch() -
bollingerBands()toBBands()
-
Set
na = NAformomentum()andROC()functions in files KST.R, RSI.R, and TDI.R, and changedROC()to usetype = "discrete"in chaikinVolatility.R.-
Made the following changes to the
ZLEMA()function:- Add
ratio = NULLargument. - Non-integer lags are a weighted mean of the two nearest observations, based on their proximity to the lag value.
- Change ‘lag = ratio^(-1)’ to fully support
ratioargument.
- Add
Changed the
BBands()function’ssdargument from a list that allows other dispersion functions to simply indicate the number of standard deviations to use.
NEW FEATURES
-
Changed
maTypearguments and updated documentation for: Added Stochastic Momentum Index
SMI()andwilliamsAD()functions and documentation.-
Added Fortran implementations of
Added NA checking/handling for many functions.
Added
ratio = NULLargument toEMA().-
Changed all usage of
roll*()to their respective Fortran implementations and removed therollFun()function. Added Fortran based functions are:
DEPRECATED & DEFUNCT
Removed
oscillator()function and transferred functionality toMACD()function.Removed
chaikinOscillator(), since it can be created viaMACD(chaikinAD(...)).
BUG FIXES
match.arg(type)inROC()changed to simple subsetting of type.Changed trailing zeros to trailing NAs in
DPO().Fixed
WMA()bug that allowedxandwtsvectors to have different length if either series had leading NAs (similar toEVWMA()function).Fixed
runCov()bug that allowedxandyvectors to have different length if either series had leading NAs (similar toEVWMA()function).Corrected
EVWMA()to start at periodninstead ofn-1.Removed
messagefunction from CCI.R, VHF.R, WPR.R, aroon.R bollingerBands.R, and stochastics.R.
Changes in 0.13.2
SIGNIFICANT USER-VISIBLE CHANGES
Changed order of
oscillator()arguments fromma.slow,ma.fast,ma.sigto the traditionalma.fast,ma.slow,ma.sig. Thanks to Jeff Ryan.The arguments to the
chaikinOscillator()function were changed as above.Changed
EVWMA()so periodncontains the value for periods(i-n+1):nand so periods1:(n-2)will be NA.Changed
EMA()so periods1:nwill be NA.
Changes in 0.13.1
SIGNIFICANT USER-VISIBLE CHANGES
Changed
bbands()tobollingerBands().Changed
stoch()tostochastic().