为金融数据添加指标

R 中的金融交易

Ilya Kipnis

Professional Quantitative Analyst and R programmer

交易指标

  • TTR:经典交易指标工具箱

  • SMA(简单移动平均)

  • 在 CTA 中常用:200 日移动平均

    • 显示过去约 10 个月的价格区间
R 中的金融交易

使用 SMA()

# 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 中的金融交易

趋势线

R 中的金融交易

让我们练习!

R 中的金融交易

Preparing Video For Download...