[R-SIG-Finance] moving average

Patrick Burns patrick at burns-stat.com
Sun Sep 23 09:39:18 CEST 2007

Asking if your code does what you think it does is
an excellent thing to do.

In this case I would try it out on something like:

A <- rnorm(30)
A[15] <- 100

And then see if the result is what I hoped.

Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
(home of S Poetry and "A Guide for the Unwilling S User")

Alexander Moreno wrote:

>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?
>i.e. does it include today in the calculation?  Or do I need to do this
>(which is what I think)?
>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
>	[[alternative HTML version deleted]]
>R-SIG-Finance at stat.math.ethz.ch mailing list
>-- Subscriber-posting only. 
>-- If you want to post, subscribe first.

More information about the R-SIG-Finance mailing list