I am currently trying to back test a strategy on a file which contains minutely data for the whole month. I would like to reset my indicators at 3:30 PM . Is there a way I can reset the indicators based on time or any other way ? Following is the code for adding data and SMA indicator to my strategy . Since the data index is time series , I could use 15:30:00 as an event to reset the SMA indicator . The data contains 1 month of minutely data .
nifty <- as.xts(read.zoo("01122016CE8100.csv", sep =",", header = TRUE, format = "%H:%M", tz = "")) SMA_str <- add.indicator(strategy = SMA_str, name = "SMA", arguments = list(x = quote(Cl(mktdata)), n = 20), label = "SMA")