下單規模函式

R 的金融交易

Ilya Kipnis

Professional Quantitative Analyst and R programmer

什麼是規則?

add.rule(strategy.st, name = "ruleSignal", 
         arguments = list(sigcol = "filterexit", 
                          sigval = TRUE, orderqty = "all", 
                          ordertype = "market",
                          orderside = "long", 
                          replace = FALSE, prefer = "Open"),
         type = "exit")
  • 若未使用 orderqty,用此指定買賣數量
  • 建立動態下單規模,而非 orderqty 的固定規模
R 的金融交易

什麼是規則?

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")
R 的金融交易

什麼是規則?

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")
  • 下單規模函式與 ruleSignal 使用相同引數清單
  • 類似 apply()
R 的金融交易

一起來練習吧!

R 的金融交易

Preparing Video For Download...