2
$\begingroup$

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")
$\endgroup$
  • $\begingroup$ Welcome to Quant.SE - could you provide some code and an example because the question is unclear as it stands $\endgroup$ – vonjd Dec 1 '16 at 17:23
  • 1
    $\begingroup$ Added some more info @vonjd $\endgroup$ – Yatharth Narang Dec 1 '16 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.