5.6 TTR

M <- momentum(Cl(AAPL), n=2)
head (M,n=5)
##              AAPL.Close
## 2003-01-02           NA
## 2003-01-03           NA
## 2003-01-06  0.003540063
## 2003-01-07 -0.001770279
## 2003-01-08 -0.012389971

5.6.1 Trading signal

Buy signal arises when momentum changes from negative to positive.

Sell signal arises when momentum changes from positive to negative.

5.6.2 Charting

chartSeries(AAPL,
            subset='2007-05::2009-01',
            theme=chartTheme('white'))
addMomentum(n=1)