Project Agenda

Row

Overview

Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to conduct analyses or create tools to support quantitative decision making.

A principle tool used in industry, goverment, non-profits, and academic fields to compensate for the information overload is the information dashboard. Functionally, a dashboard is meant to provide a user with a central resource to present in a clear and concise manner all the information neccessary to support day-to-day decision making and support operations.

Row

Objective

The objective of this laboratory is to plan, design, and create an information dashboard to support quantitative decision making. To accomplish this task, you will have to complete a number of steps:

1.Delineate the necessary decision (I will do that below). 2.Identify what information will be relevant to decision making. 3.Find and collect the data necessary to create your visualization plan. 4.Organize and summarize the collected data. 5.Design and create the best visualizations to present that information. 6.Finally organize the layout of those visualizations in a way that conforms to the theory of dashboarding. 7.Write a summary about what decisions you made based on the visualizations that you developed.

The Decision & Rules

You make investments for an organization, your objective is to purchase securities/commodities for the key objective of maximizing profits. You want to make an investment in securities/commodities to make some short term gains. You are considering investing in one of any four companies, for example: Twitter (TWTR), Microsoft (MSFT), or Apple (AAPL) (don’t use these). Choose 4 companies, commodities or any financial instrument you like, and determine which one of the four will produce the most short term gains. Use your imagination.

Key Indicator Analysis

Row

Financial Indicators

P-E Ratio - ratio of a company’s share price to it’s earnings per share. EPS - portion of a company’s profit allocated to every individual share. Dividend Yield Ratio - ratio that shows how much a company pays out in dividends each year relative to its stock price. Market Cap - the total value of a company’s shares.

Key Indicator Analysis

Stocks Overall Daily Trend

Row

Stocks Overall Daily Trend

[1] "BABA" "PDD"  "JD"   "MNSO"

Individual Stock price Trend

Column

Alibaba

Pinduoduo

Jingdong

Miniso

Monthly Return Analysis

Conclusion

Row

Key Indicators Analysis

We analyzed the key indicators (P/E Ratie, EPS, Dividend Yield, Market Cap) of Alibaba, Pinduoduo, Jingdong, Miniso, to measure their performance from Sep 2022 to Mar 2023. From the indicators we summarize:

  • P-E Ratio - Alibaba has the highest P-E Ratio (51.7), which means higher earnings growth is expected, then followed by Jindong (44.9), Miniso (37.7) and Pinduoduo (26.1).

  • EPS - Miniso has the highest P-E Ratio (19.5), which indicates how much money a company makes for each share of its stock, followed by Pinduoduo (13.4), Jindong (11.2) and Alibaba (10.6).

  • Dividend Yield - The only stock that has a Dividend Yield amount is Jindong (10%), which is a good amound of yield for investor to gain divident.

  • Market Cap - Alibaba has the highest market cap, followed by Pinduoduo and Jingdong.

---
title: "ANLY 512 - Lab 1"
author: "Ye Shen"
date: "3/28/2023"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    social: menu
    source: embed
    html_document:
    df_print: paged
    pdf_document: default
---

```{r setup, include=FALSE}
library(flexdashboard)
```
# Table of Contents {.sidebar}

* Project Agenda
  
* Key Indicator Analysis                          
  
* Stocks Overall Daily Trend

* Individual Stock price Trend

* Monthly Return Analysis

* Conclusion

# **Project Agenda**

Row {data-height=230}
-------------------------------------

### **Overview** 
Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to conduct analyses or create tools to support quantitative decision making.

A principle tool used in industry, goverment, non-profits, and academic fields to compensate for the information overload is the information dashboard. Functionally, a dashboard is meant to provide a user with a central resource to present in a clear and concise manner all the information neccessary to support day-to-day decision making and support operations.

Row
-------------------------------------
    
### **Objective** 

The objective of this laboratory is to plan, design, and create an information dashboard to support quantitative decision making. To accomplish this task, you will have to complete a number of steps:

1.Delineate the necessary decision (I will do that below).
2.Identify what information will be relevant to decision making.
3.Find and collect the data necessary to create your visualization plan.
4.Organize and summarize the collected data.
5.Design and create the best visualizations to present that information.
6.Finally organize the layout of those visualizations in a way that conforms to the theory of dashboarding.
7.Write a summary about what decisions you made based on the visualizations that you developed.

### **The Decision & Rules**

You make investments for an organization, your objective is to purchase securities/commodities for the key objective of maximizing profits. You want to make an investment in securities/commodities to make some short term gains. You are considering investing in one of any four companies, for example: Twitter (TWTR), Microsoft (MSFT), or Apple (AAPL) (don’t use these). Choose 4 companies, commodities or any financial instrument you like, and determine which one of the four will produce the most short term gains. Use your imagination.


# **Key Indicator Analysis**

Row
-------------------------

### **Financial Indicators**

P-E Ratio - ratio of a company's share price to it's earnings per share. 
EPS - portion of a company's profit allocated to every individual share. 
Dividend Yield Ratio - ratio that shows how much a company pays out in dividends each year relative to its stock price.
Market Cap - the total value of a company's shares.

### **Key Indicator Analysis**

```{r}
library(dygraphs)
library(quantmod)
library(plyr)
library(DT)
library(dplyr)
library(highcharter)
library(viridisLite)
library(ggplot2)
library(broom)
library(xts)
library(zoo)
what_metrics <- yahooQF(c("Price/Sales", 
                          "P/E Ratio",
                          "Price/EPS Estimate Next Year",
                          "PEG Ratio",
                          "Dividend Yield", 
                          "Market Capitalization"))
tickers <- c("BABA", "PDD", "JD", "MNSO")
metrics <- getQuote(paste(tickers, sep = ",", collapse = ";"), what = what_metrics)
metrics <- data.frame(Symbol = tickers, metrics[,2:length(metrics)])
colnames(metrics) <- c("Symbol", "P-E Ratio", "EPS", "Dividend Yield Ratio", "Market Cap")
DT::datatable(metrics)


```

# **Stocks Overall Daily Trend**

## Row

### Stocks Overall Daily Trend {data-width=500}

```{r}

start <- as.Date("2022-09-01") 
end <- as.Date("2023-03-01")

getSymbols(tickers, src = "yahoo", from = start, to = end)
stocks = as.xts(data.frame(A = BABA[, "BABA.Adjusted"], 
B = PDD[, "PDD.Adjusted"], C = JD[, "JD.Adjusted"], 
E = MNSO[,"MNSO.Adjusted"]))

```{r}
names(stocks) <- c("BABA", "PDD", "JD","MNSO")
index(stocks) <- as.Date(index(stocks))

stocks_series <- tidy(stocks) %>% 
  
  ggplot(aes(x=index,y=value, color=series)) +
  labs(title = "Daily Stock Adjusted Prices Comparison from 09/2022 - 03/2023",
       
       subtitle = "Among Alibaba, Pinduoduo, Jingdong, Miniso",
       caption = " Source: Yahoo Finance",
       color = "Stock",
       x = "Date",
       y = "End of day Adjusted Price ($)") +
  scale_color_manual(values = c("purple", "blue", "yellow","orange"))+
  geom_line()

stocks_series
```

# **Individual Stock price Trend**

## Column {data-height=800 .tabset .tabset-fade}

### Alibaba {data-width=500}
```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_BABA <- SMA(Ad(BABA), 7) 
ma14_BABA <- SMA(Ad(BABA), 14) 
close_BABA <- BABA$BABA.Close

all_BABA <- cbind(ma7_BABA, close_BABA, ma14_BABA)
colnames(all_BABA) <- c('7-days MA','Close','14-days MA')

dygraph(all_BABA, main = "Price Vs Moving Average BABA") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)
```
### Pinduoduo {data-width=500}
```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_PDD <- SMA(Ad(PDD), 7) 
ma14_PDD <- SMA(Ad(PDD), 14) 
close_PDD <- PDD$PDD.Close

all_PDD <- cbind(ma7_PDD, close_PDD, ma14_PDD)
colnames(all_PDD) <- c('7-days MA','Close','14-days MA')

dygraph(all_PDD, main = "Price Vs Moving Average PDD") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)
```
### Jingdong {data-width=500}
```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_JD <- SMA(Ad(JD), 7) 
ma14_JD <- SMA(Ad(JD), 14) 
close_JD <- JD$JD.Close

all_JD <- cbind(ma7_JD, close_JD, ma14_JD)
colnames(all_JD) <- c('7-days MA','Close','14-days MA')

dygraph(all_JD, main = "Price Vs Moving Average JD") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)
```
### Miniso {data-width=500}
```{r echo=FALSE, warning=FALSE, message=FALSE}
ma7_MNSO <- SMA(Ad(MNSO), 7) 
ma14_MNSO <- SMA(Ad(MNSO), 14) 
close_MNSO <- MNSO$MNSO.Close

all_MNSO <- cbind(ma7_MNSO, close_MNSO, ma14_MNSO)
colnames(all_MNSO) <- c('7-days MA','Close','14-days MA')

dygraph(all_MNSO, main = "Price Vs Moving Average MNSO") %>% 
dyAxis("y", label = "Price (USD)") %>%
  dyOptions(axisLineWidth = 1.5,
            colors = RColorBrewer::brewer.pal(3, "Set2")) %>%
  dyHighlight(
    highlightSeriesBackgroundAlpha = 1.0,
    highlightSeriesOpts = list(strokeWidth = 2)) %>%
  dyRangeSelector(height = 30)

```
# **Monthly Return Analysis**
```{r}
BABAmr <- monthlyReturn(BABA)
PDDmr <- monthlyReturn(PDD)
JDmr <- monthlyReturn(JD)
MNSOmr <- monthlyReturn(MNSO)

mg.return <- merge.xts(BABAmr, PDDmr, JDmr, MNSOmr)
colnames(mg.return) <- c("ALIBABA", "PINDUODUO", "JINGDONG", "MINISO")

dygraph(mg.return, main = "Monthly Return") %>%
  dyAxis("y", label = "Return") %>%
  dyOptions(colors = RColorBrewer::brewer.pal(4, "Dark2")) %>%
  dyHighlight(highlightSeriesBackgroundAlpha = 0.3,
              highlightSeriesOpts = list(strokeWidth = 3)) %>%
  dyRangeSelector(height = 30)
```
# **Conclusion**

Row
-------------------------

### **Key Indicators Analysis**
We analyzed the key indicators (P/E Ratie, EPS, Dividend Yield, Market Cap) of Alibaba, Pinduoduo, Jingdong, Miniso, to measure their performance from Sep 2022 to Mar 2023. From the indicators we summarize:

+ `r kableExtra::text_spec("**P-E Ratio**", color = "#5c5c5c")` - Alibaba has the highest P-E Ratio (51.7), which means higher earnings growth is expected, then followed by Jindong (44.9), Miniso (37.7) and Pinduoduo (26.1). 

+ `r kableExtra::text_spec("**EPS**", color = "#5c5c5c")` - Miniso has the highest P-E Ratio (19.5), which indicates how much money a company makes for each share of its stock, followed by Pinduoduo (13.4), Jindong (11.2) and Alibaba (10.6). 

+ `r kableExtra::text_spec("**Dividend Yield**", color = "#5c5c5c")` - The only stock that has a Dividend Yield amount is Jindong (10%), which is a good amound of yield for investor to gain divident.

+ `r kableExtra::text_spec("**Market Cap**", color = "#5c5c5c")` - Alibaba has the highest market cap, followed by Pinduoduo and Jingdong.

### **Individual Trends Analysis from Visualization**
We created visualization for overall ajusted stock prices, individual stock prices and montly return. Alibaba, although with the highest Cap and stock price, is currenly declining as shown in individual trend, and is currently among the lowest monthly return rate as shown in the monthly return chart. Based on the price trend,Miniso, even with the lowest Cap, is shown to be the only stock that has been steadily rising for the past 6 month and the trend seems to continue. Also it has shown to have the higest montly return among the 4 stocks during most of the time over the past 6 month. In conclusion, for short-term investment, I would prefer to invest in Miniso.