powered by
Description
genMA(df, ma)
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.
Dataframe with price data
# of periods for the moving average to calculate
SPYDMA200 <- genMA(SPYdaily, 14)
Run the code above in your browser using DataLab