Hi Andreas,

The following works, in the candlesticks library

(Note what I did with BodyHi and BodyLo). If I keep as.xts, the code does
not work (the computation of reclass fails.) No idea why. Perhaps you could
test on Lion on the Macbook Pro. Strange no? I am using the latest version
of R:
version 2.15.0 (2012-03-30) )

======

myHammer = function(TS, minlowershadowCL = 2/3, maxuppershadowCL =
0.1, minbodyCL = 0.1)
{
    if (!is.OHLC(TS)) {
        stop("Price series must contain Open, High, Low and Close.")
    }
    CL <- Hi(TS) - Lo(TS)
    #BodyHi <- as.xts(apply(cbind(Op(TS), Cl(TS)), 1, max))
    BodyHi <- apply(cbind(Op(TS), Cl(TS)), 1, max)
print("1")
    #BodyLo <- as.xts(apply(cbind(Op(TS), Cl(TS)), 1, min))
    BodyLo <- apply(cbind(Op(TS), Cl(TS)), 1, min)
print("2")
    Hammer <- reclass(BodyLo - Lo(TS) > CL * minlowershadowCL &
        Hi(TS) - BodyHi <= CL * maxuppershadowCL & abs(Cl(TS) -
        Op(TS)) > CL * minbodyCL, TS)

    colnames(Hammer) <- c("Hammer")
    xtsAttributes(Hammer) <- list(bars = 1)
    return(Hammer)

	[[alternative HTML version deleted]]

