Stock Selection
Stock Selection
group_by(symbol) %>%
tq_transmute(select = adjusted,
mutate_fun = periodReturn,
period = "monthly",
type = "log",
col_rename = "monthly.returns")
Warning message:
“There were 3 warnings in `dplyr::mutate()`.
The first warning was:
ℹ In argument: `nested.col = purrr::map(...)`.
ℹ In group 1: `symbol = "GMD.VN"`.
Caused by warning in `to_period()`:
! missing values removed from data
ℹ Run `dplyr::last_dplyr_warnings()` to see the 2 remaining warnings.”
Warning message:
“Removed 1 row containing missing values or values outside the scale range
(`geom_line()`).”
# Perform one-sample t-test to check if the daily mean return is greater than 0
t_test_results <- VN_prices_daily_log_returns_2_years %>%
group_by(symbol) %>%
summarize(t_test = list(t.test(daily.returns, mu = 0, alternative = "greater"))) %>%
mutate(p_value = map_dbl(t_test, ~ .x$p.value),
mean_return = map_dbl(t_test, ~ .x$estimate)) %>%
select(symbol, mean_return, p_value)
A tibble: 3 × 3
symbol mean_return p_value
# Filter the prices for one week ago and the latest available date
prices_one_week_ago <- VN_prices %>%
filter(date == one_week_ago & symbol %in% c("REE.VN", "GMD.VN", "VCI.VN"))
# Merge the dataframes to get the prices one week ago and the latest prices
merged_prices <- merge(prices_one_week_ago, prices_latest, by = "symbol", suffixes = c(".one_week_ago", ".latest"))
#Reported return
merged_prices %>%
select(symbol, adjusted.one_week_ago, adjusted.latest, return)
A data.frame: 3 × 4
symbol adjusted.one_week_ago adjusted.latest return
format_size format_bold format_italic code link image format_quote format_list_numbered format_list_bulleted horizontal_rule ψ mood
### Trading Strategy
I bought 500 stocks for each of the three GMD, REE, and VCI. For REE, Trading Strategy
refrigeration company, I expects demand for its products to rise becau
hotter weather in the South. For GMD, I guess that transporation may r I bought 500 stocks for each of the three GMD, REE, and VCI. For REE, a
is approaching the holiday season. Last but not least, I choose VCI be
read on this site https://tikop.vn/blog/ refrigeration company, I expects demand for its products to rise because
co-phieu-vci-danh-gia-tiem-nang-dau-tu-gia-co-phieu-vci-hien-nay-7813# of hotter weather in the South. For GMD, I guess that transporation may
-tu-co-phieu-vci-khong that VCI is a product with high potential.
rise as it is approaching the holiday season. Last but not least, I choose
VCI because I read on this site https://tikop.vn/blog/co-phieu-vci-danh-gia-
tiem-nang-dau-tu-gia-co-phieu-vci-hien-nay-7813#co-nen-dau-tu-co-phieu-
vci-khong that VCI is a product with high potential.