Order sizing functions

Financial Trading in R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

What are rules?

add.rule(strategy.st, name = "ruleSignal", 
         arguments = list(sigcol = "filterexit", 
                          sigval = TRUE, orderqty = "all", 
                          ordertype = “market",
                          orderside = "long", 
                          replace = FALSE, prefer = “Open"),
         type = "exit")
  • Specify how much to buy or sell if orderqty not used
  • Create dynamic order sizes as opposed to orderqty’s static order size
Financial Trading in R

What are rules?

add.rule(strategy.st, name = "ruleSignal", 
         arguments = list(sigcol = "filterexit", 
                          sigval = TRUE, orderqty = "all", 
                          ordertype = “market”,
                          orderside = "long",
                          replace = FALSE, prefer = Open”, 
                          osFUN = ..., tradeSize = ..., 
                          maxSize = ...),
         type = "exit")
Financial Trading in R

What are rules?

add.rule(strategy.st, name = "ruleSignal", 
         arguments = list(sigcol = "filterexit", 
                          sigval = TRUE, 
                          ordertype = “market”,
                          orderside = "long",
                          replace = FALSE, prefer = Open”, 
                          osFUN = ..., tradeSize = ..., 
                          maxSize = ...),
         type = "exit")
  • Order sizing function under same list of arguments in ruleSignal
  • Similar to apply()
Financial Trading in R

Let's practice!

Financial Trading in R

Preparing Video For Download...