Skip to content

Technical Trading Rules

16packages dependsuggested by 8
2.9Mdownloads / year
67.0%test coverage
13/13flavors OK

Overview

About

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.

Changes in 0.24.4
  • 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. Refactored ATR() to use the TR() 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) because na.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 the WMA() 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 when x had any leading NA. Thanks to Ethan B. Smith for the report. (#121)
  • The TRIX() signal line did not use nSig unless maType was 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

CRAN checks
13OK
Slowest check: 4.1 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.24.4
READMEYes · 281 wordsVignettesNoNEWSYes · 100% structured · mentions 0.24.4Citation fileNoWebsitenot declared in DESCRIPTION
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

2.9M
CRAN downloads in the past year
Rank #334 · ~8K/day · ~242.8K/mo
Daily download trend is not available in this view yet.
116.1K30 days
297K90 days
2.9M1 year
Compare downloads with other packages →
Also on15K r2u254 autocran242.4K conda_forge1.5K c2d4u

Repository

351Stars
100Forks
27Open issues
5Open PRs
8Releases
366Commits
10Commit identities
rfinancetechnical-analysisalgorithmic-trading
License file reads as GPL-2.0 · 366 commits · Last activity 2026-02-28 · +0.6% stars, 30d · Default branch at 0.24.4.1, ahead of CRAN 0.24.4 (checked 2026-10-18)
Responsiveness
How these are sampled
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

2025-08-25 · 3392026-10-10 · 351
PracticesBeta

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.

Continuous integration (1)
GitHub Actions
Governance and community (4)
Issue templatesPR templateFunding

Funding links: GitHub Sponsors

The repository owner accepts GitHub Sponsors

Reproducibility and dev environment (1)
Makefile
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

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.

Depends (0)
none
Imports (3)
LinkingTo (1)
Suggests (1)
Enhances (0)
none
Reverse dependencies
16direct
127indirect
Depends 4 · Imports 12
Suggested by 8
Show all 24 packagesHide all 24 packages
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (2)
Maintainer, Author · added in 2.9.2
Contributor

Maintainer since 0.2 (2009)

Listed in earlier versions (2)
Josh Ulrich
no longer listed · 2.6.0 to 0.2
Smith
no longer listed · 0.24.4
Releases (31)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
  • R
    R 3.0.0 released · 2013-04-03
  • 3.0.0Latest
    record
    2013-03-18 · current release · diff ↗
  • 2.15.1
    record
    2012-03-31 · diff ↗
Show 40 earlier eventsHide 40 earlier events
  • R
    R 2.15.0 released · 2012-03-30
  • R
    R 2.14.0 released · 2011-10-31
  • 2.13.2
    record
    2011-08-30 · diff ↗
  • R
    R 2.13.0 released · 2011-04-13
  • R
    R 2.12.0 released · 2010-10-15
  • R
    R 2.11.0 released · 2010-04-22
  • 2.11.0
    record
    2010-03-23 · diff ↗ ·
    added 2 exports
    VWAP, VWMA
  • R
    R 2.10.0 released · 2009-10-26
  • 2.10.0
    record
    2009-08-27 · diff ↗
  • 2.9.2
    record
    2009-07-29 · diff ↗ ·
    added 2 exports
    adjRatios, GMMA
  • R
    R 2.9.0 released · 2009-04-17
  • R
    R 2.8.0 released · 2008-10-20
  • R
    R 2.7.0 released · 2008-04-22
  • 2.6.2
    record
    2008-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.1
    record
    2007-10-23 · diff ↗
  • R
    R 2.6.0 released · 2007-10-03
  • 2.6.0
    record
    2007-09-27 · diff ↗
  • 0.24.4
    record
    2023-11-28 · diff ↗ ·
    removed 1 export
    VMA
    added 1 export
    TR
  • 0.24.3
    record
    2021-12-12 · diff ↗ ·
    added 1 export
    keltnerChannels
  • 0.24.2
    record
    2020-09-01 · diff ↗
  • 0.24.1
    record
    2020-08-28 · diff ↗
  • 0.24.0
    record
    2020-08-10 · diff ↗ ·
    added 1 export
    CTI
  • 0.23-6
    record
    2019-12-15 · diff ↗
  • 0.23-5
    record
    2019-09-23 · diff ↗
  • 0.23-4
    record
    2018-09-20 · diff ↗
  • 0.23-3
    record
    2018-01-24 · diff ↗
  • 0.23-2
    record
    2017-07-11 · diff ↗ ·
    added 1 export
    SNR
  • 0.23-1
    record
    2016-03-21 · diff ↗
  • 0.23-0
    record
    2015-07-10 · diff ↗ ·
    added 4 exports
    ALMA, HMA, naCheck, ultimateOscillator
  • 0.22-0
    record
    2013-03-17 · diff ↗ ·
    added 2 exports
    rollSFM, runPercentRank
  • 0.21-1
    record
    2012-04-01 · diff ↗
  • 0.21-0
    record
    2011-08-30 · diff ↗ ·
    added 3 exports
    DVI, PBands, VMA
  • 0.20-2
    record
    2010-03-25 · diff ↗
  • 0.20-1
    record
    2009-08-28 · diff ↗
  • 0.20-0
    record
    2009-07-30 · diff ↗
  • 0.14-0
    record
    2008-01-24 · diff ↗
  • 0.13-1
    record
    2007-10-25 · diff ↗
  • 0.13
    record
    2007-10-03 · diff ↗
  • 0.2
    record
    2009-02-11
  • R
    R 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
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("TTR")
Ulrich, J., & Smith, E. B. (2023). TTR: Technical Trading Rules (Version 0.24.4) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for TTR version 0.24.4 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy