更多规则机制 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:选择入场价位

    • K 线:open、high、low、close
    • 默认:在下一天/下一根 K 线的收盘价买入
R 中的金融交易

让我们练习吧!

R 中的金融交易

Preparing Video For Download...