I have created the chandelier indicator. The function is:
chandlier_exit_long = function(x,k = 3,
n = 22){
high = rollapplyr(Hi(x), width = n, FUN
= max)
atr = ATR(x, n)[, "atr"]
z = high - atr
names(z) = "Chandelier_Exit_Long"
return(z)
}
I have used quantmods function newTA to create:
addChandExitLong = newTA(FUN =
chandlier_exit_long, preFUN = OHLC, col
= "red")

That's a warning, not an error. Though it does indicate something is not quite right. The problem is that
rollapplyrdoes not pad/fill withNAby default. So you need to change your function to:Or you could replace the
rollapplyr()call withrunMax(Hi(x), n).