envelope: Moving Average Envelope

Description Usage Arguments Value References Examples

View source: R/Technical Indicators.R

Description

This function creates a moving average envelope.

Usage

1
envelope(x, maType = "EMA", n = 22, p = 2.5, ...)

Arguments

x

an xts object that contains OHLC data

maType

moving average type. Default is "EMA". But any

n

Number of periods. Default is 22.

p

percentage of moving the upper and lower bounderies away from the midpoint of the moving average. Default is 2.5. Needs to be between 0 and 100.

...

any other passthrough parameters

Value

Returns a timeseries with the lower and upper bound and the midpoint of the chosen moving average.

References

https://www.investopedia.com/terms/e/envelope.asp

Examples

1
2
3
4
5
6
## Not run: 
getSymbols("ADM", from = "2018-01-01", to = "2018-07-01")
chartSeries(ADM)
addTA(envelope(ADM), on = 1)

## End(Not run)

pverspeelt/Quantfunctions documentation built on Jan. 6, 2019, 4:02 a.m.