This hypothetical Venture Capital firm wants to make an investment plan. The objective of this proposal is to purchase securities/commodities and the goal is to maximize the profits. We are focusing our investment on gaining short term gains. The company invests $5 million each in four companies which is Apple, Walmart,HP and Oracle.
We have collected relevant data from YahooFinance and we look at stock key performance metrics and the historical candlestick plots for each company when making our investment decision.
Looking at the bar chart of Closing prices, Apple stands out best among all the three companies. Comparing Market Capitalization, P/E ratio, and Price/EPS estimate Next year, Apple is leading followed by Walmart, Oracle, and HP. As shown in the plots, we can see an increase in the number of prices in Both Apple and Walmart. However, prices drop in the month of August 2019 for Walmart. Furthermore, Oracle was at its peak in July 2019, but there had been a constant decrease after that. Lastly, HP shows a constant change in prices for the entire year.
At the beginning of 2020, all company’s prices were rising and Apple gained its peak in February 2020. Due to COVID-19, the prices have been declined for all companies. But, in April 2020 both Apple and Walmart came back to business, while HP remained the same. Oracle recovered after April but then remained constant after that. Comparing all three companies, Apple has the highest prices.
Looking at the stocks and the historical plot analysis, we would recommend investing in Apple is best which has the capability to generate the highest profit.
---
title: "ANLY 512 Lab 1: Dashboard Laboratory"
author: "Ruchil Barya, Komal Bhagat"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
social: scroll
source_code: embed
---
```{r setup, message=FALSE, warning=FALSE}
library(quantmod)
library(flexdashboard)
library(dygraphs)
library(lubridate)
```
OBJECTIVE
=======================================================================
Row
-----------------------------------------------------------------------
This hypothetical Venture Capital firm wants to make an investment plan. The objective of this proposal is to purchase securities/commodities and the goal is to maximize the profits. We are focusing our investment on gaining short term gains. The company invests $5 million each in four companies which is Apple, Walmart,HP and Oracle.
We have collected relevant data from YahooFinance and we look at stock key performance metrics and the historical candlestick plots for each company when making our investment decision.
```{r}
```
SUMMARY
=======================================================================
Looking at the bar chart of Closing prices, Apple stands out best among all the three companies. Comparing Market Capitalization, P/E ratio, and Price/EPS estimate Next year, Apple is leading followed by Walmart, Oracle, and HP.
As shown in the plots, we can see an increase in the number of prices in Both Apple and Walmart. However, prices drop in the month of August 2019 for Walmart. Furthermore, Oracle was at its peak in July 2019, but there had been a constant decrease after that. Lastly, HP shows a constant change in prices for the entire year.
At the beginning of 2020, all company's prices were rising and Apple gained its peak in February 2020. Due to COVID-19, the prices have been declined for all companies. But, in April 2020 both Apple and Walmart came back to business, while HP remained the same. Oracle recovered after April but then remained constant after that.
Comparing all three companies, Apple has the highest prices.
Column {.tabset data-width=500}
-----------------------------------------------------------
### Tabular View
```{r}
what_metrics <- yahooQF(c("Price/Sales",
"P/E Ratio",
"Price/EPS Estimate Next Year",
"PEG Ratio",
"Dividend Yield",
"Market Capitalization"))
tickers <- c("AAPL", "WMT", "HPQ", "ORCL")
# Not all the metrics are returned by Yahoo.
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=what_metrics)
#Add tickers as the first column and remove the first column which had date stamps
metrics <- data.frame(Symbol=tickers, metrics[,2:length(metrics)])
#Change colnames
colnames(metrics) <- c("Symbol", "P-E Ratio", "Price EPS Estimate Next Year", "Div Yield", "Market Cap")
#Persist this to the csv file
#write.csv(metrics, "FinancialMetrics.csv", row.names=FALSE)
DT::datatable(metrics)
```
### Stock Closing Prices
```{r}
ticker <- c("AAPL", "WMT", "HPQ", "ORCL")
invisible(getSymbols(ticker, from="2019-06-01"))
ClosingPrices <- do.call(merge, lapply(ticker, function(x) Cl(get(x))))
dateperiod<-c("2019-06-01")
dygraph(ClosingPrices, main="Closing Price in Dollars", group="Stock") %>%
dyAxis("y", label="Closing Price(USD)") %>%
dyOptions(axisLineWidth = 2.0, colors = RColorBrewer::brewer.pal(5, "Set1")) %>%
dyHighlight(highlightSeriesBackgroundAlpha = 1.0,
highlightSeriesOpts = list(strokeWidth = 3)) %>%
dyRangeSelector(height = 130)
```
### Market capitalization
```{r}
library(ggplot2)
metrics<-data.frame(na.fill(metrics,0))
metrics$Market.Cap <- as.numeric(metrics$Market.Cap)
ggplot(metrics,aes(x=Symbol,y=Market.Cap,fill=Symbol))+
geom_bar(stat = "identity")+
labs(x="Company name",y="Market Capitalization")+
scale_fill_manual(name = "Company",
labels = c("Apple","WMT","HP","ORACLE"),
values = c("#9DACBB", "#6E8DAB" ,"#3F6D9B", "#104E8B"))
```
### P/E ratio
```{r}
ggplot(metrics,aes(x=Symbol,y=P.E.Ratio,fill=Symbol))+
geom_bar(stat = "identity")+
labs(x="Company name",y="P/E Ratio")+
scale_fill_manual(name = "Company",
labels = c("Apple","WMT","HP","ORACLE"),
values = c("Gray10","Gray20","Gray40", "Gray"))
```
### Price/EPS Estimate Next Year
```{r}
ggplot(metrics,aes(x=Symbol,y=Price.EPS.Estimate.Next.Year,fill=Symbol))+
geom_bar(stat = "identity")+
labs(x="Company name",y="Price Estimate Next year")+
scale_fill_manual(name = "Company",
labels = c("Apple","WMT","HP","ORACLE"),
values = c("#9DACBB", "#6E8DAB" ,"#3F6D9B", "#104E8B"))
```
Column {.tabset data-width=600}
------------------------------------------------
### APPLE
```{r}
invisible(getSymbols("AAPL", src = "yahoo", from='2019-06-01'))
AP_x <- AAPL
dygraph(AP_x[, -5], main = "Apple") %>%
dyCandlestick() %>%
dyAxis("y", label="Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 4,
highlightSeriesOpts = list(strokeWidth = 5),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 75)
```
### Walmart
```{r}
invisible(getSymbols("WMT", src = "yahoo", from='2019-06-01'))
WMT_x <- WMT
dygraph(WMT_x[, -5], main = "Walmart") %>%
dyCandlestick() %>%
dyAxis("y", label="Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 5,
highlightSeriesOpts = list(strokeWidth = 2),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 75)
```
### HP
```{r}
invisible(getSymbols("HPQ", src = "yahoo", from='2019-06-01'))
HPQ_x <- HPQ
dygraph(HPQ_x[, -5], main = "HP") %>%
dyCandlestick() %>%
dyAxis("y", label=" Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(6, "Set1")) %>%
dyHighlight(highlightCircleSize = 5,
highlightSeriesOpts = list(strokeWidth = 6),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 75)
```
### Oracle
```{r}
invisible(getSymbols("ORCL", src = "yahoo", from='2019-06-01'))
ORCL_x <- ORCL
dygraph(ORCL_x[, -5], main = "Oracle") %>%
dyCandlestick() %>%
dyAxis("y", label="Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(5, "Set1")) %>%
dyHighlight(highlightCircleSize = 4,
highlightSeriesOpts = list(strokeWidth = 3),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 75)
```
CONCLUSION
=======================================================================
Row
-----------------------------------------------------------------------
Looking at the stocks and the historical plot analysis, we would recommend investing in Apple is best which has the capability to generate the highest profit.