# NOT RUN {
# load data
data('ssec')
# add technical indicators
dt_ti1 = pq_addti(ssec, sma=list(n=20), sma=list(n=50), macd = list())
# only technical indicators
dt_ti2 = pq_addti(ssec, sma=list(n=20), sma=list(n=50), macd = list(), col_kp = FALSE)
# self-defined technical indicators
bias = function(x, n=50, maType='SMA') {
library(TTR)
(x/do.call(maType, list(x=x, n=n))-1)*100
}
dt_ti3 = pq_addti(ssec, bias = list(n = 200))
# }
Run the code above in your browser using DataLab