Learn R Programming

avfintools (version 0.1.0)

genMA: Generate moving averages

Description

Description

Usage

genMA(df, ma)

Value

a vector with the same number of columns as df showing the moving averages. Periods before moving average should be not considered for use. Output is kept same columns for compatibility.

Arguments

df

Dataframe with price data

ma

# of periods for the moving average to calculate

Examples

Run this code
SPYDMA200 <- genMA(SPYdaily, 14)

Run the code above in your browser using DataLab