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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.