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.0008846439
## 2003-01-07 -0.0004420741
## 2003-01-08 -0.0030974926

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)