Publications by Christian Piereth

Publish Document

23.09.2024

# Load packages # Core library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ...

217 sym R (3102 sym/9 pcs) 1 img

Publish Document

23.09.2024

1 Import stock prices of your choice 2 Convert prices to returns by quarterly ## # A tibble: 201 × 3 ## asset data returns ## <chr> <date> <dbl> ## 1 VSMPX 2015-04-30 -0.0153 ## 2 VSMPX 2015-05-29 0.0138 ## 3 VSMPX 2015-06-30 -0.0171 ## 4 VSMPX 2015-07-31 0.0162 ## 5 VSMPX 2015-08-31 -0.0619 ## 6 VSMPX 2015-09-30 ...

276 sym 1 img

Publish Document

18.09.2024

# Load Packages library(tidyverse) library(tidyquant) Get stock prices and convert to returns Ra <- c("GM", "DKNG", "PFE") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = "monthly", ...

199 sym R (2731 sym/10 pcs)

Publish Document

17.09.2024

# load packages library(tidyverse) library(tidyquant) Stock Index tq_index_options() ## [1] "DOW" "DOWGLOBAL" "SP400" "SP500" "SP600" data <- tq_index("sp400") Stock Exchange tq_exchange_options() ## [1] "AMEX" "NASDAQ" "NYSE" data <- tq_exchange("NYSE") tq_get stock prices from Yahoo Finance stock <- tq_get("TSLA") Economic Da...

114 sym R (737 sym/10 pcs)

Publish Document

17.09.2024

# load packages library(tidyverse) # core function ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1...

60 sym R (2224 sym/8 pcs) 3 img

Publish Document

17.09.2024

Provide Major Takeaways from Chapter 1 in 50 words. In Chapter 1 it was mainly about using tidyquant. Tidyquant is a function that makes it easier to Analyze Stocks and Finances. Tidyquant uses Yahoo Finances, Fred and a bunch of other software to easily import a ton of data. You can also graph the data and make tables and calculate stocks together...

372 sym

Publish Document

17.09.2024

# load packages library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ ti...

140 sym R (3902 sym/11 pcs)

Apply to data 2

12.09.2024

Import stock prices stocks <- tq_get(c("NFLX", "AMZN" , "GM"), get = "stock.prices", from = "2016-01-01", to = "2017-01-01") stocks ## # A tibble: 756 × 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 NFLX ...

217 sym Python (7312 sym/29 pcs) 1 img

Code Along charter 5

10.09.2024

import data flights ## # A tibble: 336,776 × 19 ## year month day dep_time sched_dep_time dep_delay arr_time sched_arr_time ## <int> <int> <int> <int> <int> <dbl> <int> <int> ## 1 2013 1 1 517 515 2 830 819 ## 2 2013 1 1 533 529 ...

338 sym Python (19094 sym/49 pcs) 1 img

Code Along 2

10.09.2024

Coding basics R as a calculator 1000/10 ## [1] 100 x <- 1000/10 # x assignment symbol What’s in a name? Calling functions Use of TAB seq(from = 1, to = 10) ## [1] 1 2 3 4 5 6 7 8 9 10 continuation character, + Printing to screen y <- seq(from = 1, to = 10) y ## [1] 1 2 3 4 5 6 7 8 9 10...

169 sym Python (158 sym/7 pcs)