Project Usage Example

Download Repo

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)

Help

?pittlHafnerLuo::get_index

Important Notes:

We implemented two sources:

Usage Examples

FCS

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")

Yahoo Finance

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


anewruser/finance documentation built on Dec. 19, 2021, 3:36 a.m.