More rule mechanics II

Financial Trading in R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

More arguments to ruleSignal

  • replace
  • prefer
Financial Trading in R

Structure

add.rule(strategy.st, name = "ruleSignal", 
         arguments = list(sigcol = "filterexit", 
                          sigval = TRUE, orderqty = "all", 
                          ordertype = "market",
                          orderside = "long", 
                          replace = FALSE, prefer = "Open"),
         type = "exit")
  • replace: TRUE is other signals canceled, else FALSE

  • prefer: when to enter into a position

    • bar: open, high, low, close
    • default: buy at close of next day/bar
Financial Trading in R

Let's practice!

Financial Trading in R

Preparing Video For Download...