library(quantmod)
## Warning: package 'quantmod' was built under R version 4.2.2
## Loading required package: xts
## Warning: package 'xts' was built under R version 4.2.2
## Loading required package: zoo
## Warning: package 'zoo' was built under R version 4.2.2
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## ################################### WARNING ###################################
## # We noticed you have dplyr installed. The dplyr lag() function breaks how #
## # base R's lag() function is supposed to work, which breaks lag(my_xts). #
## # #
## # If you call library(dplyr) later in this session, then calls to lag(my_xts) #
## # that you enter or source() into this session won't work correctly. #
## # #
## # All package code is unaffected because it is protected by the R namespace #
## # mechanism. #
## # #
## # Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning. #
## # #
## # You can use stats::lag() to make sure you're not using dplyr::lag(), or you #
## # can add conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop #
## # dplyr from breaking base R's lag() function. #
## ################################### WARNING ###################################
## Loading required package: TTR
## Warning: package 'TTR' was built under R version 4.2.2
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
help("quantmod")
## starting httpd help server ... done
getSymbols("TSLA")
## [1] "TSLA"
head(TSLA)
## TSLA.Open TSLA.High TSLA.Low TSLA.Close TSLA.Volume TSLA.Adjusted
## 2010-06-29 1.266667 1.666667 1.169333 1.592667 281494500 1.592667
## 2010-06-30 1.719333 2.028000 1.553333 1.588667 257806500 1.588667
## 2010-07-01 1.666667 1.728000 1.351333 1.464000 123282000 1.464000
## 2010-07-02 1.533333 1.540000 1.247333 1.280000 77097000 1.280000
## 2010-07-06 1.333333 1.333333 1.055333 1.074000 103003500 1.074000
## 2010-07-07 1.093333 1.108667 0.998667 1.053333 103825500 1.053333
tail(TSLA)
## TSLA.Open TSLA.High TSLA.Low TSLA.Close TSLA.Volume TSLA.Adjusted
## 2023-02-17 199.99 208.44 197.50 208.31 213080200 208.31
## 2023-02-21 204.99 209.71 197.22 197.37 180018600 197.37
## 2023-02-22 197.93 201.99 191.78 200.86 191828500 200.86
## 2023-02-23 203.91 205.14 196.33 202.07 146360000 202.07
## 2023-02-24 196.33 197.67 192.80 196.88 141965900 196.88
## 2023-02-27 202.03 209.42 201.26 207.63 161028300 207.63
chart_Series(TSLA)
chartSeries(TSLA, theme ="white")
getSymbols("SASA.IS")
## Warning: SASA.IS contains missing values. Some functions will not work if
## objects contain missing values in the middle of the series. Consider using
## na.omit(), na.approx(), na.fill(), etc to remove or replace them.
## [1] "SASA.IS"
tail(SASA.IS)
## SASA.IS.Open SASA.IS.High SASA.IS.Low SASA.IS.Close SASA.IS.Volume
## 2023-02-20 117.3 120.2 115.1 117.2 16853186
## 2023-02-21 116.8 118.7 112.6 112.9 17371654
## 2023-02-22 112.7 114.4 107.3 107.3 11679787
## 2023-02-23 102.1 111.5 101.5 107.7 17172982
## 2023-02-24 107.3 107.7 104.5 104.9 7630033
## 2023-02-27 104.6 108.5 101.3 107.4 18934613
## SASA.IS.Adjusted
## 2023-02-20 117.2
## 2023-02-21 112.9
## 2023-02-22 107.3
## 2023-02-23 107.7
## 2023-02-24 104.9
## 2023-02-27 107.4
chart_Series(SASA.IS)
chartSeries(SASA.IS, theme ="white")
getSymbols("SPDYNCBRTINTCD", src="FRED")
## [1] "SPDYNCBRTINTCD"
chart_Series(SPDYNCBRTINTCD)
GETFX
getFX("USD/TRY")
## [1] "USD/TRY"
chartSeries(USDTRY , theme ="white")