addMA: Add Moving Average to Chart

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Add one or more moving averages to a chart.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
addSMA(n = 10, on = 1, with.col = Cl, overlay = TRUE, col = "brown")

addEMA(n = 10, wilder = FALSE, ratio=NULL, on = 1,
       with.col = Cl, overlay = TRUE, col = "blue")

addWMA(n = 10, wts=1:n, on = 1, with.col = Cl, overlay = TRUE, col = "green")

addDEMA(n = 10, on = 1, with.col = Cl, overlay = TRUE, col = "pink")

addEVWMA(n = 10, on = 1, with.col = Cl, overlay = TRUE, col = "yellow")

addZLEMA(n = 10, ratio=NULL, on = 1, with.col = Cl, overlay = TRUE, col = "red")

Arguments

n

periods to average over

wilder

logical; use wilder?

wts

a vector of weights

ratio

a smoothing/decay ratio

on

apply to which figure (see below)

with.col

using which column of data (see below)

overlay

draw as overlay

col

color of MA

Details

see the appropriate base MA functions in TTR for more details and references.

Value

A moving average indicator will be draw on the current chart. A chobTA object will be returned silently.

Author(s)

Jeffrey A. Ryan

References

see MovingAverages in TTR written by Josh Ulrich

See Also

addTA

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
addSMA()
addEMA()
addWMA()
addDEMA()
addEVWMA()
addZLEMA()

## End(Not run)

R-Finance/quantmod documentation built on May 9, 2017, 9:41 p.m.