We will add the Bollinger Bands using the add BBands

BBands command and the MACD trend

we will add the Bollinger Bands using the addBBands() command and the MACD trend-following momentum indicator using the add MACD() command to get more insights into the stock price evolution.
 library(Quandl)
> library(xts)
> currencies <- c( "USD", "CHF", "GBP", "JPY", "RUB", "CAD", "AUD")
> currencies <- paste("CURRFX/EUR", currencies, sep = "")
> currency_ts <- lapply(as.list(currencies), Quandl, start_date="2005-01-
+ 01",end_date="2013-06-07", type="xts")
Error in charToDate(x) :
  character string is not in a standard unambiguous format
> currency_ts <- lapply(as.list(currencies), Quandl, start_date="2005-01-
+ 01",end_date="2013-06-07", type="xts")
Error in charToDate(x) :
  character string is not in a standard unambiguous format
> Q <- cbind(
+     currency_ts[[1]]$Rate,currency_ts[[3]]$Rate,currency_
+     ts[[6]]$Rate,currency_ts[[7]]$Rate)
Error: unexpected symbol in:
"    currency_ts[[1]]$Rate,currency_ts[[3]]$Rate,currency_
    ts"
> matplot(Q, type = "l", xlab = "", ylab = "", main = "USD, GBP, CAD, AUD",
+         xaxt = 'n', yaxt = 'n')
Error in matplot(Q, type = "l", xlab = "", ylab = "", main = "USD, GBP, CAD, AUD",  :
  object 'Q' not found
> library(quantmod)
[1] "BMW.DE"
> BMW<-bmw_stock$BMW.DE
> head(BMW)
           BMW.DE.Open BMW.DE.High BMW.DE.Low
2010-01-04      31.820      32.455     31.820
2010-01-05      31.960      32.410     31.785
2010-01-06      32.450      33.040     32.360
2010-01-07      32.650      33.200     32.380
2010-01-08      33.335      33.430     32.515
2010-01-11      32.995      33.050     32.110
           BMW.DE.Close BMW.DE.Volume BMW.DE.Adjusted
2010-01-04       32.050       1808170        24.15409
2010-01-05       32.310       1564182        24.35004
2010-01-06       32.810       2218604        24.72685
2010-01-07       33.100       2026145        24.94541
2010-01-08       32.655       1925894        24.61004
2010-01-11       32.170       2157825        24.24452
> chartSeries(BMW,multi.col=TRUE,theme="white")
> addMACD()
> addBBands()
> BMW_return <-
+     log(BMW$BMW.DE.Close/BMW$BMW.DE.Open)
> qqnorm(BMW_return, main = "Normal Q-Q Plot of BMW daily log return",
+        xlab = "Theoretical Quantiles",
+        ylab = "Sample Quantiles", plot.it = TRUE, datax = FALSE
+ )
> qqline(BMW_return, col="red")
> getSymbols("BMW.DE", env = bmw_stock, src = "yahoo", from =
+                as.Date("2014-01-01"), to = as.Date("2018-12-31"))
[1] "BMW.DE"
> BMW<-bmw_stock$BMW.DE
> head(BMW)
           BMW.DE.Open BMW.DE.High BMW.DE.Low
2014-01-02       85.90       86.10      83.38
2014-01-03       83.63       84.51      83.35
2014-01-06       84.00       84.53      82.87
2014-01-07       83.10       84.01      82.41
2014-01-08       83.82       84.66      83.73
2014-01-09       84.13       85.13      83.54
           BMW.DE.Close BMW.DE.Volume BMW.DE.Adjusted
2014-01-02        83.54       1499492        69.45904
2014-01-03        83.98        826285        69.82488
2014-01-06        82.99        987242        69.00174
2014-01-07        83.55       1231698        69.46736
2014-01-08        84.45       1435898        70.21566
2014-01-09        83.86       1297442        69.72510
> chartSeries(BMW,multi.col=TRUE,theme="white")
> addMACD()
> addBBands()
Learn PYTHON

Post a Comment

4 Comments

  1. THE FX-AGENCY ADVISOR 3 THE WORLDS LEADING MULTI-FUNCTIONAL HIGH END FOREX SYSTEM FX-AGENCY ADVISOR 3
    Trade Easy ,
    Secure and
    Professional way,
    👇
    check
    FX-AGENCY ADVISOR 3 detail


    Crypto trading course
    Crypto quantum leap

    Be a professional YouTuber and start your carrier
    Tube Mastery and Monetization by matt

    ReplyDelete
  2. Harrah's Casino | New Orleans Hotel & Casino
    Harrah's Casino is w88 the hotel 메리트카지노 of choice for 바카라 배팅 법 those looking for a premier casino choegocasino.com twitter experience that 사이트 추천 is unforgettable. The casino is located just minutes

    ReplyDelete
  3. PokerStars Review 2021 - Online Casinos - ProFans
    Check out our detailed review of PokerStars, its poker 더킹카지노 sister sites and what 메리트 카지노 고객센터 all the different 메리트 카지노 쿠폰 types of games 슬롯 가입 머니 it offers to the player on the 바카라 사이트

    ReplyDelete
  4. Casino Nights 2, Blackjack, Roulette, and Slots - KTM Hub
    The casino is available to play with a 여주 출장샵 virtual ticket 안산 출장안마 for every $15 you spend on a sportsbook ticket. This means if 계룡 출장샵 you want to play 여주 출장안마 with a casino 속초 출장샵

    ReplyDelete