about emaTA

Chongnan Gao gaochongnan at gmail.com
Fri Sep 23 08:50:38 CEST 2011


hi,

I checked code of emaTA in fTrading and the head looks like:

ema <- function (x, lambda = 0.1, startup = 0)
{
    y = as.vector(x)
    if (lambda >= 1)
        lambda = 2/(lambda + 1)
    if (startup == 0)
        startup = floor(2/lambda)
    if (lambda == 0) {
        ema = rep(mean(x), length(x))
    }

esp. startup = floor(2/lambda). That translate to 2.88*(memory
length). Is that necessary to take such a long sub-array to
calculating startup mean value?

Best,
Chongnan



More information about the Rmetrics-core mailing list