This presentation uses Apple's stock price - from Jan 03 2007 to Aug 24 2018 - to make the plot.
Besides the close price, I calculated the 30-day and 10-day moving average. Based on the 10-day moving average, I calculated the Bollinger Bands with parameter 2.
## [1] "AAPL"
## AAPL.Close Date ma10 ma30 upper lower ## 2018-08-24 216.16 2018-08-24 213.696 203.1527 219.7356 207.6564 ## 2018-08-27 217.94 2018-08-27 214.603 204.0537 220.1234 209.0826 ## 2018-08-28 219.70 2018-08-28 215.598 204.9953 220.8089 210.3871 ## 2018-08-29 222.98 2018-08-29 216.872 206.0813 222.4756 211.2684 ## 2018-08-30 225.03 2018-08-30 218.043 207.1863 225.0628 211.0232 ## 2018-08-31 227.63 2018-08-31 219.048 208.3927 228.2969 209.7991