Technical Trading Rules
Overview
A collection of over 50 technical indicators for creating technical trading rules. The package also provides fast implementations of common rolling-window functions, and several volatility calculations.
- Added Ethan B. Smith as a contributor. Thanks Ethan!
NEW FEATURES
- Added a
TR()function to calculate the true high, true low, and true range. RefactoredATR()to use theTR()function. Thanks to @openbmsjsc and Steve Bronder for the reports, and Ethan B. Smith for the PR. (#18, #114, #124)
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)
Show all changes in 0.24.4Hide the rest of the changes in 0.24.4
- 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)
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 44includes a package overview page
- Examples that run
- 100%38 run in a plain check (1 of them under a condition)
- Exported functions with examples
- 86%
- Documented parameters
- 100%
- Return-value docs
- 98%
- Help pages citing references
- 86%
Downloads
Repository
- PRs merged (all time)
- 69%
- Median days to close, 50 most recently updated closed issues
- 10
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
6 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/joshuaulrich/ttr on 2026-10-18.
Funding links: GitHub Sponsors
The repository owner accepts GitHub Sponsors
Dependencies
Installing TTR adds 3 packages (3 with compiled code, 1.8 MB of source tarballs). Heaviest: curl 714 KB, zoo 675 KB, xts 470 KB.
Show all 24 packagesHide all 24 packages
Code & Tests
Datasets
People & History
Maintainer since 0.2 (2009)
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- RR 3.0.0 released · 2013-04-03
- 3.0.0Latest
- 2.15.12012-03-31 · diff ↗
Show 40 earlier eventsHide 40 earlier events
- RR 2.15.0 released · 2012-03-30
- RR 2.14.0 released · 2011-10-31
- 2.13.22011-08-30 · diff ↗
- RR 2.13.0 released · 2011-04-13
- RR 2.12.0 released · 2010-10-15
- RR 2.11.0 released · 2010-04-22
- 2.11.0
- RR 2.10.0 released · 2009-10-26
- 2.10.02009-08-27 · diff ↗
- 2.9.2
- RR 2.9.0 released · 2009-04-17
- RR 2.8.0 released · 2008-10-20
- RR 2.7.0 released · 2008-04-22
- 2.6.22008-01-23 · diff ↗ ·
added 47 exports
ADX, aroon, ATR, BBands, CCI, chaikinAD, chaikinVolatility, CLV, CMF, CMO, DEMA, DPO, EMA, EMV, EVWMA, getYahooData, growth, KST, lags, MACD, momentum, OBV, ROC, RSI, runCor, runCov, runMAD, runMax, runMean, runMedian and 17 more - 2.6.12007-10-23 · diff ↗
- RR 2.6.0 released · 2007-10-03
- 2.6.02007-09-27 · diff ↗
- 0.24.4
- 0.24.3
- 0.24.22020-09-01 · diff ↗
- 0.24.12020-08-28 · diff ↗
- 0.24.0
- 0.23-62019-12-15 · diff ↗
- 0.23-52019-09-23 · diff ↗
- 0.23-42018-09-20 · diff ↗
- 0.23-32018-01-24 · diff ↗
- 0.23-2
- 0.23-12016-03-21 · diff ↗
- 0.23-0
- 0.22-0
- 0.21-12012-04-01 · diff ↗
- 0.21-0
- 0.20-22010-03-25 · diff ↗
- 0.20-12009-08-28 · diff ↗
- 0.20-02009-07-30 · diff ↗
- 0.14-02008-01-24 · diff ↗
- 0.13-12007-10-25 · diff ↗
- 0.132007-10-03 · diff ↗
- 0.22009-02-11
- RR 2.5.0 released · 2007-04-24
Package metadata
- First published
- 2007-09-27
- Total releases
- 31 / 19 yrs
- License
- GPL (>= 2) OSI
- Bundled data
- 82 KB / 1 file
- Download size
- 311 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("TTR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.