library(quantmod)
library(PerformanceAnalytics)
s <- get(getSymbols('SPY'))["2012::"]
s$sma20 <- SMA(Cl(s) , 20)
s$position <- ifelse(Cl(s) > s$sma20 , 1 , -1)
myReturn <- lag(s$position) * dailyReturn(s)
charts.PerformanceSummary(cbind(dailyReturn(s),myReturn))
s$dc <- DonchianChannel(,s$SPY.High,s$SPY.Low)
i get a error
Error in try.xts(HL, error = as.matrix) :
argument "HL" is missing, with no default
What mistake am i doing for s$dc?