Publications by Daniel Lee
Apply6
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize expected returns and risk to make it easier to compare the performance of multiple assets and portfolios. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("MTN", "AAPL", "NFLX", "DIS", "GE") prices <- tq_get(x= symbols, ...
1198 sym R (4244 sym/21 pcs) 2 img
Apply12
# Load packages # Core library(tidyverse) library(tidyquant) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. 1 Import stock prices Choose your stocks from 2012-12-31 to present. symbols <- c("AAPL", "NKE", "WMT", "AMZN", "NFLX") prices <- tq_get...
906 sym R (7919 sym/8 pcs) 1 img
Apply7
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and compare skewness of your portfolio and its assets. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("MTN", "AAPL", "NFLX", "DIS", "GE") prices <- tq_get(x= symbols, get ="stock.prices", f...
708 sym R (3621 sym/23 pcs) 2 img
Apply9
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the performance of your portfolio in terms of Sharpe Ratio. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("MTN", "AAPL", "NFLX", "DIS", "GE") prices <- tq_get(x= symbols, ...
918 sym R (3927 sym/20 pcs) 1 img
Codealong 13
# Load packages # Core library(tidyverse) library(tidyquant) # time series library(timetk) Goal Simulate future portfolio returns five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” market: “SPY” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbol...
457 sym R (9749 sym/42 pcs) 2 img
Apply 13
# Load packages # Core library(tidyverse) library(tidyquant) # Source function source("../00_scripts/simulate_accumulation.R") 1 Import stock prices Revise the code below. Replace symbols with your stocks. Replace the from and the to arguments to date from 2012-12-31 to present. symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get...
2117 sym R (5072 sym/24 pcs) 1 img
code along 12 FA real
# Load packages # Core library(tidyverse) library(tidyquant) library(readr) # Time series library(lubridate) library(tibbletime) # modeling library(broom) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. five stocks: “SPY”, “EFA”, “IJS”, �...
687 sym R (15438 sym/23 pcs) 2 img
Apply 12 FA
# Load packages # Core library(tidyverse) library(tidyquant) library(readr) # Time series library(lubridate) library(tibbletime) # modeling library(broom) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. 1 Import stock prices Choose your stocks from 2...
1109 sym R (33289 sym/22 pcs) 1 img
Apply 12 DA
Import your data data("mtcars") mtcars <- as_tibble(mtcars) Repeat the same operation over different columns of a data frame Case of numeric variables mtcars %>% map_dbl(.x = ., .f = ~mean(x = .x)) ## mpg cyl disp hp drat wt qsec ## 20.090625 6.187500 230.721875 146.687500 3.596563 3.217250 ...
650 sym Python (6292 sym/34 pcs) 1 img
Apply 13
# Load packages # Core library(tidyverse) library(tidyquant) # Source function source("../00_scripts/simulate_accumulation.R") 1 Import stock prices Revise the code below. Replace symbols with your stocks. Replace the from and the to arguments to date from 2012-12-31 to present. symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get...
1141 sym R (5090 sym/24 pcs) 1 img