TechnicalAnalysis: Tools for the Technical Analysis

Description Usage Arguments Value Author(s) Examples

Description

A collection and description of functions for the technical analysis of stock markets. The collection provides a set of the most common technical indicators.

Utility Functions:

emaTA Exponential Moving Average,
biasTA Bias Indicator,
medpriceTA Medium Price Indicator,
typicalpriceTA Typical Price Indicator,
wcloseTA Weighted Close Indicator,
rocTA Rate of Change,
oscTA Oscillator Indicator.

Oscillator Indicators:

momTA Momentum Indicator,
macdTA MACD Indicator,
cdsTA MACD Signal Line,
cdoTA MACD Oscillator,
vohlTA High/Low Volatility,
vorTA Volatility Ratio.
stochasticTA Stochastics Oscillator,
fpkTA Fast Percent K,
fpdTA Fast Percent D,
spdTA Slow Percent D,
apdTA Averaged Percent D,
wprTA William's Percent R,
rsiTA Relative Strength Index.

S-Plus Like Moving Averages:

SMA Simple Moving Average,
EWMA Exponentially Weighted Moving Average.

Usage

 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
emaTA(x, lambda, startup = 0)
biasTA(x, lag)
medpriceTA(high, low)
typicalpriceTA(high, low, close)
wcloseTA(high, low, close)
rocTA(x, lag)
oscTA(x, lag1 = 25, lag2 = 65)

momTA(x, lag)
macdTA(x, lag1, lag2)
cdsTA(x, lag1 = 12, lag2 = 26, lag3 = 9)
cdoTA(x, lag1 = 12, lag2 = 26, lag3 = 9)
vohlTA(high, low)
vorTA(high, low)

stochasticTA(close, high, low, lag1 = 5, lag2 = 3, lag3 = 5, 
    type = c("fast", "slow")) 
fpkTA(close, high, low, lag)
fpdTA(close, high, low, lag1, lag2)
spdTA(close, high, low, lag1, lag2, lag3)
apdTA(close, high, low, lag1, lag2, lag3, lag4)
wprTA(close, high, low, lag)
rsiTA(close, lag)

SMA(x, n = 5)
EWMA(x, lambda, startup = 0)

Arguments

lag, lag1, lag2, lag3, lag4

integer values, time lags.

n

[SMA] -
an integer value, time lag.

lambda

[emaTA][EWMA] -
a numeric value between zero and one giving the decay length of the exponential moving average. If an integer value greater than one is given, lambda is used as a lag of "n" periods to calculate the decay parameter.

startup

[emaTA][EWMA] -
an integer value, the startup position of the exponential moving average, by default 0.

type

[stochasticTA] -
a character string, either "fast" or ""slow" characterizing the type of the percent K and percent D indicator. By default type="fast"

x, high, low, close

a numeric vector of prices, either opening, closing, or high and low values. For ohlcPlot a multivariate time series object of class mts.

Value

*TA
The technical Indicators return the following numeric vectors (or matrix):

emaTA returns the Exponential Moving Average, EMA
biasTA returns the EMA-Bias,
medpriceTA returns the Medium Price,
typicalpriceTA returns the Typical Price,
wcloseTA returns the Weighted Closing Price,
rocTA returns the Rate of Change Indicator,
oscTA returns the EMA Oscillator Indicator,
momTA returns the Momentum Oscillator,

macdTA returns the MACD Oscillator,
cdsTA returns the MACD Signal Line,
cdo returns the MACD Oscillator,
vohlTA returns the High/Low Volatility Oscillator,
vorTA returns Volatility Ratio Oscillator,

stochasticTA returns a 2-column matrix with percent K and D Indicator,
fpkTA returns the Fast Percent-K Stochastics Indicator,
fpdTA returns the Fast Percent-D Stochastics Indicator,
spdTA returns the Slow Percent-D Stochastics Indicator,
apdTA returns the Averaged Percent-D Stochastics Indicator,
wprTA returns the Williams Percent-R Stochastics Indicator,
rsiTA returns the Relative Strength Index Stochastics Indicator.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## data -
   # Load MSFT Data:
   x = MSFT
   colnames(x)
   x = x[, "Close"]
   head(x)
   
## emaTA -
   # Exponential Moving Average:
   y = emaTA(x, lambda = 9)   
   seriesPlot(x)
   lines(y, col = "red")

Example output

Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
[1] "Open"   "High"   "Low"    "Close"  "Volume"
GMT
             Close
2000-09-27 60.6250
2000-09-28 61.3125
2000-09-29 60.3125
2000-10-02 59.1250
2000-10-03 56.5625
2000-10-04 55.4375

fTrading documentation built on May 2, 2019, 9:34 a.m.