Using the trend of the stock by using exponential smoothing method

visExpSmoothing(data, alpha, name)

Arguments

data

xts a time series object

alpha

A numeric vector of the smoothing parameter which defines the weighting. It should be between 0 and 1

name

a character vector of the name of the column to be used in moving average calculation

Value

ggplot line plot of specific stock's historical prices and exponentially smoothed prices

Examples

quantmod::getSymbols("AAPL")
#> [1] "AAPL"
visES_AAPL <- visExpSmoothing(AAPL, 0.3, 'AAPL.Close')