2  Group 1

Managers: Brian Kim and Pietra Kumagai

2.1 The setup

p1_list  <-c("WEGE3.SA","JHSF3.SA","BRSR6.SA","WIZS3.SA","PETR4.SA","BEEF3.SA","LREN3.SA","ELET3.SA","ENBR3.SA","SAPR11.SA","FLRY3.SA","ROKU","SNAP","PINS","META","BABA","NFLX","ATXG","TCEHY","KO")
p1_w     <- c(0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04)
p1_exc   <- c("BRL", "BRL","BRL","BRL","BRL","BRL","BRL","BRL","BRL","BRL","BRL","USD","USD","USD","USD","USD","USD","USD","USD","USD"  )
p1_wlist <- cbind(p1_list, p1_w, p1_exc)
colnames(p1_wlist) <- c('ticker','weights','Currency')
#Download data Financial
p1 <- yf_get(tickers = p1_list, first_date = start, last_date = end,freq_data = "daily", thresh_bad_data = 0.5)
p1 <- p1[, c("ticker", "ref_date", "price_adjusted" ) ]
p1 <- merge(p1, p1_wlist , by = "ticker")
# Download data Exchange rate
getFX("BRL/USD",from=start , to = end) 
exchanges <- as.data.frame(BRLUSD)
exchanges$ref_date <- as.Date(rownames(exchanges))
# Merge
p1 <- merge(p1, exchanges, by = "ref_date")
p1$BRL.USD[p1$Currency == "USD"] <- 1
# Adjusting currency
p1$price_adj <- p1$price_adjusted * p1$BRL.USD
# Calculating return
ret <- p1 %>%
       group_by(ticker) %>%
       tq_transmute(select = price_adj,
                    mutate_fun = periodReturn,
                    period = "daily",
                    col_rename = "ret")
p1 <- merge(p1, ret, by = c("ref_date", "ticker"))
# Data tabulation
p1$ret_product <- p1$ret * as.numeric(p1$weights)
# Creating a df of portfolios return
p1_ret  <- p1 %>%                      
            group_by(ref_date) %>%
            summarise_at(vars(ret_product),
                         list(p1_return = sum)) %>% as.data.frame()
#Calculating cumulative return per day
for(i in (1:nrow(p1_ret) ) ) {
p1_ret$p1_cum[i] <- Return.cumulative(p1_ret$p1_return[1:i])
}
#Calculating cumulative return total
p1_sharpe <- data.frame(matrix(NA, nrow = 1,ncol = 4))
colnames(p1_sharpe) <- c('p1_return', 'p1_sd', 'p1_rf' , 'p1_sharpe')
p1_sharpe$p1_return <- Return.cumulative(p1_ret$p1_return)
p1_sharpe$p1_sd <- sd(p1_ret$p1_return[2:nrow(p1_ret)])
p1_sharpe$p1_rf <- (1+0.03)^(nrow(p1_ret)/252) -1
p1_sharpe$p1_sharpe <- (p1_sharpe$p1_return - p1_sharpe$p1_rf)  / p1_sharpe$p1_sd

2.2 The portfolio

This is the portfolio of this group:

p1_wlist
      ticker      weights Currency
 [1,] "WEGE3.SA"  "0.06"  "BRL"   
 [2,] "JHSF3.SA"  "0.06"  "BRL"   
 [3,] "BRSR6.SA"  "0.06"  "BRL"   
 [4,] "WIZS3.SA"  "0.06"  "BRL"   
 [5,] "PETR4.SA"  "0.06"  "BRL"   
 [6,] "BEEF3.SA"  "0.06"  "BRL"   
 [7,] "LREN3.SA"  "0.06"  "BRL"   
 [8,] "ELET3.SA"  "0.06"  "BRL"   
 [9,] "ENBR3.SA"  "0.06"  "BRL"   
[10,] "SAPR11.SA" "0.06"  "BRL"   
[11,] "FLRY3.SA"  "0.04"  "BRL"   
[12,] "ROKU"      "0.04"  "USD"   
[13,] "SNAP"      "0.04"  "USD"   
[14,] "PINS"      "0.04"  "USD"   
[15,] "META"      "0.04"  "USD"   
[16,] "BABA"      "0.04"  "USD"   
[17,] "NFLX"      "0.04"  "USD"   
[18,] "ATXG"      "0.04"  "USD"   
[19,] "TCEHY"     "0.04"  "USD"   
[20,] "KO"        "0.04"  "USD"   

Checking the sum of weights. The sum of weights is:

2.3 The performance

The current cumulative return of this Portfolio is -1.95 percent.

The current standard deviation of daily returns of this Portfolio is 2.21 percent.

The current Sharpe of this portfolio is -0.9983.

ggplot(p1_ret, aes(x= ref_date, y= p1_cum) ) +  geom_line(color = "brown2", size = 1.25) +
  labs(y = "Portfolio return", 
       x = "Time",
       title = "Group 1: Brian Kim and Pietra Kumagai") + theme_solarized()