Publications by John Baldwin

Quiz 1

18.02.2021

# Load packages library(tidyquant) ## Warning: package 'tidyquant' was built under R version 4.0.3 ## Warning: package 'lubridate' was built under R version 4.0.3 ## Warning: package 'PerformanceAnalytics' was built under R version 4.0.3 ## Warning: package 'xts' was built under R version 4.0.3 ## Warning: package 'zoo' was built under R versio...

1144 sym R (2704 sym/22 pcs)

Quiz 5

15.04.2021

# Load packages library(tidyquant) library(tidyverse) # Import stock prices and calculate returns returns_yearly <- c("^DJI", "^GSPC", "^IXIC") %>% tq_get(get = "stock.prices", from = "1990-01-01", to = "2020-11-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutat...

2642 sym R (4560 sym/17 pcs) 1 img

Quiz 4

07.04.2021

Witht the given stock, conduct the Bollinger Bands analysis by answering the questions below. ## # A tibble: 313 x 8 ## symbol date open high low close volume adjusted ## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 MSFT 2020-01-02 159. 161. 158. 161. 22622100 159. ## 2 MSFT 2020-01-03 158....

2410 sym R (2817 sym/5 pcs) 1 img

Quiz 2

04.03.2021

In this exercise, use Chapter 4.2 Quantitative vs. Quantitative Data Visualization with R. # Load packages library(tidyquant) library(tidyverse) # Import stock prices stock_prices <- tq_get(c("AAPL", "MSFT", "AMZN"), get = "stock.prices", from = "2021-01-01") # Calculate daily returns stock_returns <- stock_prices %>% group_by(...

1891 sym R (2873 sym/8 pcs) 2 img

Quiz 3

19.03.2021

# Load packages library(tidyquant) library(tidyverse) Q1 dividends Import dividends of General Motors and Ford since 2010. tq_get(c("GM", "F"), get = "dividends") ## # A tibble: 58 x 3 ## symbol date value ## <chr> <date> <dbl> ## 1 GM 2014-03-14 0.3 ## 2 GM 2014-06-06 0.3 ## 3 GM ...

1427 sym R (4409 sym/15 pcs)

Quiz 6

28.04.2021

Q1 Get monthly returns of Tesla, Amazon, and Netflix for the last 5 years. # Load packages library(tidyquant) library(tidyverse) from <- today() - years(5) stock_returns_monthly <- c("TSLA", "AMZN","NFLX") %>% tq_get(get = "stock.prices", from = from) %>% group_by(symbol) %>% tq_transmute(select = adjusted, ...

1565 sym R (9976 sym/20 pcs)

Term Paper

07.05.2021

Finance students in the past have participated in national student competitions. They are a great opportunity to practice and further your knowledge and skills you learned in the finance program at PSU. Because not all of you are finance major, grading will be generous as long as you follow the instructions (e.g., number counts for answers). In a...

5881 sym