sma: Compute a simple moving average

View source: R/movingAverages.R

smaR Documentation

Compute a simple moving average

Description

An implementation of the basic simple moving average. A sample mean is computed over a moving window of a given time series.

Usage

sma(x, n = 30)

Arguments

x

the time-series of observations

n

the length of the moving window to average over (positive integer)

Details

An error is returned if the length of the moving window is larger than the sample size of the data.

Value

vector


shill1729/trader documentation built on Dec. 27, 2022, 10:55 p.m.