Hi,

If I want to make a 12 day exponentially weighted moving average using only
past data on a time series A, will this do the trick?

filter(A,exp(-c(1:12)/12)/sum(exp(-c(1:12)/12)),method="convolution",sides=1)

i.e. does it include today in the calculation?  Or do I need to do this
(which is what I think)?

filter(A,c(0,exp(-c(1:12)/12)/sum(exp(-c(1:12)/12))),method="convolution",sides=1)

I'm trying to play around with an MACD model and want to see the daily
returns of days where the 12-day moving average < 26 day moving average and
12-day > 26 day

Thanks,
Alex

	[[alternative HTML version deleted]]

