更多規則機制 II

R 的金融交易

Ilya Kipnis

Professional Quantitative Analyst and R programmer

ruleSignal 的更多引數

  • replace
  • prefer
R 的金融交易

結構

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 會取消其他訊號,否則為 FALSE

  • prefer:進場定價依據

    • bar:open、high、low、close
    • 預設:於次日/下一根 K 的收盤買入
R 的金融交易

一起來練習吧!

R 的金融交易

Preparing Video For Download...