Publications by Colton Petrosino
Document
# Load packages library(tidyquant) library(tidyverse) Q1 dividends Import dividends of General Motors and Ford since 2010. mult_stocks <- tq_get(c("GM", "F" ), get = "dividends", from = "2010-01-01") mult_stocks ## # A tibble: 58 x 3 ## symbol date value ## <chr> <date> <dbl> ## 1 ...
1698 sym R (3294 sym/11 pcs)
Quiz 2
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(symbol) ...
2203 sym R (2832 sym/6 pcs) 2 img
Quiz 4
Witht the given stock, conduct the Bollinger Bands analysis by answering the questions below. Q1 Calculate 20-day moving averages and 20-day running standard deviation. Save the result under stock and print it. Hint: Take stock, pipe it to tidyquant::tq_mutate to calculate 20-day moving averages, pipe it to tidyquant::tq_mutate to calculate 20-d...
3629 sym 1 img
Quiz 6
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, ...
1621 sym R (7964 sym/18 pcs)
Term Paper
title: “Term Paper” author: “Colton Petrosino” output: html_document: toc: true — 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 wil...
6425 sym