TTR: Functions to create Technical Trading Rules (TTR)

Description Details Author(s) References Examples

Description

This package contains many of the most popular technical analysis functions, as well as functions to retrieve U.S. stock symbols, and data from Yahoo Finance.

Details

Users will probably be most interested in the following functions:
ADX
BBands
changes
MovingAverages
MACD
RSI
runFun
stoch
VWAP
WebData

Author(s)

Joshua Ulrich

Maintainer: Joshua Ulrich

References

The following sites were used to code/document this package:
https://www.fmlabs.com/reference/default.htm
https://www.metastock.com/Customer/Resources/TAAZ/
https://www.linnsoft.com/indicators
https://school.stockcharts.com/doku.php?id=technical_indicators

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
data(ttrc)

# Bollinger Bands
bbands <- BBands( ttrc[,c("High","Low","Close")] )

# Directional Movement Index
adx <- ADX(ttrc[,c("High","Low","Close")])

# Moving Averages
ema <- EMA(ttrc[,"Close"], n=20)
sma <- SMA(ttrc[,"Close"], n=20)

# MACD
macd <- MACD( ttrc[,"Close"] )

# RSI
rsi <- RSI(ttrc[,"Close"])

# Stochastics
stochOsc <- stoch(ttrc[,c("High","Low","Close")])

### Note: you must have a working internet connection
### for the examples below to work!
if (interactive()) {
  # Fetch U.S. symbols from the internet
  nyseSymbols <- stockSymbols("NYSE")

  # Fetch Yahoo! Finance data from the internet
  ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE)
}

TTR documentation built on Dec. 12, 2021, 9:07 a.m.

Related to TTR in TTR...