Adding indicators to financial data

Financial Trading in R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

Trading indicators

  • TTR: toolbox of classical trading indicators

  • SMA (Simple Moving Average)

  • Popular for CTA’s: 200-day moving average

    • Displays where prices have been over the past 10 months
Financial Trading in R

Using 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")
Financial Trading in R

The trend line

Financial Trading in R

Let's practice!

Financial Trading in R

Preparing Video For Download...