rm(list = ls()) #cred <- git2r::cred_user_pass(rstudioapi::askForPassword("username"), rstudioapi::askForPassword("Password")) #devtools::install_git("https://git-inf.technikum-wien.at/finance/finance2021/pkgs/pittl_hafner_luo.git",credentials = cred) #alternative: devtools::install_git("https://github.com/anewruser/finance.git")
#devtools::install_git("https://git-inf.technikum-wien.at/finance/finance2021/pkgs/catsar.git", credentials = cred)
library(tidyquant) library(pittlHafnerLuo)
?pittlHafnerLuo::get_index
We implemented two sources:
Yahoo: here we implemented typical web crawling. In addition we used
stockmarketmba.com
to get the identifiers (such as sedol
) if existing.
Hence, this source is very slow
FCSAPI: here we used a typical API
. Please, do not overuse it as there is
a monthly as well as hourly limit!!
Unfortunatly, the ATX is not supported by that API!
dow<-pittlHafnerLuo::get_index("Dow Jones","fcs","united-states") #attention: symbols of the fcs api might not 100% match with tidyquant symbols! dow %>% tidyquant::tq_get(get="stock.prices",from="2021-06-01")
Sys.sleep(60) pittlHafnerLuo::get_index("DAX","fcs","germany")
Sys.sleep(60) pittlHafnerLuo::get_index("JASDAQ","fcs","japan")
Be carefull: too many connections will lead to a 503 exception: then simply re-run the failed chunck!
Sys.sleep(5) atx<-pittlHafnerLuo::get_index("ATX") #no identifier, sedol are available atx %>% tidyquant::tq_get(get="stock.prices",from="2021-06-01")
Sys.sleep(10) pittlHafnerLuo::get_index("GDAXI") #no identifier, sedol are available
For US shares, we also have identifiers and sedol!
Sys.sleep(15) pittlHafnerLuo::get_index("IXIC")
Sys.sleep(5) pittlHafnerLuo::get_index("OMX")
Also for that members, we get identifiers!
Sys.sleep(15) pittlHafnerLuo::get_index("IXIC") #nasdaq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.