R 中的金融交易
Ilya Kipnis
Professional Quantitative Analyst and R programmer
TTR:经典交易指标工具箱
SMA(简单移动平均)
在 CTA 中常用:200 日移动平均
# Compute a simple moving average (SMA) across 200 days
sma <- SMA(x = Cl(LQD), n = 200)
# Add the SMA line to your plot of LQD closing price
plot(Cl(LQD))
lines(sma, col = "red")

R 中的金融交易