Stock Price View

Column

Disney (DIS)

Cisco Systems (CSCO)

T-Mobile US (TMUS)

Lyondell Basell (LYB)

Metrics Comparison

Column

Adjusted Closing Price

Trading Volume

Decision Summary

Column

The stocks shortlisted for investment were Disney (DIS), Cisco Systems (CSCO), T-Mobile US (TMUS) and Lyondell Basell (LYB). Various data points were gathered for a one year period (from 2018-05-11 to 2019-05-11) from Yahoo Finance. The first tab “Stock Price View” contains candlestick charts for stock prices for each company. Disney’s stocks seem to be doing well since mid-April 2019. Cisco’s stocks seem to be falling slowly after it hit its highest peak. T-Mobile’s stocks seem to be on the rise and is at its highest peak right now. Lyondell Basell’s stocks seem to be falling sharply. The second tab “Metrics Comparison” containts adjusted closing price and trading volumes across comparies over time. Disney, Cisco and T-Mobile seem to be having positive slopes for adjusted stock prices, while Lyondell Basell seems to be having a negative slope. Cisco, T-Mobile and Lyondell Basell seem to be having an average/steady change in trading volume, while Disney seems to be having an increase in trading volume. In light of these visualizations-based findings and in anticipation of the launch of Disney+ in November 2019, I would recommend investing in Disney for short-term gains.

---
title: "RichyVarghese_ANLY512-90-O-2019-LateSpring"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
    vertical_layout: fill
---

#Stock Price View

```{r setup, include=FALSE}
library(flexdashboard)
library(pdfetch)
library(dygraphs)
library(xts)
companies <- c("DIS", "CSCO", "TMUS", "LYB")
#Cisco Systems
#Disney
#T-Mobile US
#LyondellBasell
```

Column {.tabset}
-----------------------------------------------------------------------

###Disney (DIS)

```{r}
disneystocks <- pdfetch_YAHOO("DIS", fields = c("open", "high", "low", "close"), from = as.Date("2018-05-11"), interval = "1d")
colnames(disneystocks) <- c("Open", "High", "Low", "Close")
m <- tail(disneystocks, n = 365)
dygraph(m, ylab = "Stock Price ($)") %>%
  dyCandlestick() %>%
    dyLegend(width = 400) %>%
      dyRangeSelector(dateWindow = c("2019-02-11", "2019-05-11"))
```

###Cisco Systems (CSCO)

```{r}
ciscostocks <- pdfetch_YAHOO("CSCO", fields = c("open", "high", "low", "close"), from = as.Date("2018-05-11"), interval = "1d")
colnames(ciscostocks) <- c("Open", "High", "Low", "Close")
m <- tail(ciscostocks, n = 365)
dygraph(m, ylab = "Stock Price ($)") %>%
  dyCandlestick() %>%
    dyLegend(width = 400) %>%
      dyRangeSelector(dateWindow = c("2019-02-11", "2019-05-11"))
```

###T-Mobile US (TMUS)

```{r}
tmobilestocks <- pdfetch_YAHOO("TMUS", fields = c("open", "high", "low", "close"), from = as.Date("2018-05-11"), interval = "1d")
colnames(tmobilestocks) <- c("Open","High","Low","Close")
m <- tail(tmobilestocks, n = 365)
dygraph(m, ylab = "Stock Price ($)") %>%
  dyCandlestick() %>%
    dyLegend(width = 400) %>%
      dyRangeSelector(dateWindow = c("2019-02-11", "2019-05-11"))
```

###Lyondell Basell (LYB)

```{r}
lyobastocks <- pdfetch_YAHOO("LYB", fields = c("open", "high", "low", "close"), from = as.Date("2018-05-11"), interval = "1d")
colnames(lyobastocks) <- c("Open","High","Low","Close")
m <- tail(lyobastocks, n = 365)
dygraph(m, ylab = "Stock Price ($)") %>%
  dyCandlestick() %>%
    dyLegend(width = 400) %>%
      dyRangeSelector(dateWindow = c("2019-02-11", "2019-05-11"))
```

#Metrics Comparison

Column
-----------------------------------------------------------------------

###Adjusted Closing Price
```{r}
pricedata <- pdfetch_YAHOO(companies, fields = c("open","adjclose"), from = as.Date("2018-05-11"), interval = "1d")
adjclosingprice <- cbind(pricedata$DIS.adjclose, pricedata$CSCO.adjclose, pricedata$TMUS.adjclose, pricedata$LYB.adjclose)
colnames(adjclosingprice) <- c("DIS", "CSCO", "TMUS", "LYB")
m <- tail(adjclosingprice, n = 365)
dygraph(m, ylab = "Adjusted Closing Price ($)", group = "stocks") %>%
  dyOptions(strokeWidth = 2, colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
    dyHighlight(highlightCircleSize = 3, highlightSeriesBackgroundAlpha = 0.2, hideOnMouseOut = TRUE) %>%
      dyLegend(width = 400) %>%
        dyRangeSelector(dateWindow = c("2019-02-11", "2019-05-11"))
```

###Trading Volume
```{r}
volumedata <- pdfetch_YAHOO(companies, fields = c("open", "high", "low", "close","volume","adjclose"), from = as.Date("2018-05-11"), interval = "1d")
tradingvol <- cbind(volumedata$DIS.volume, volumedata$CSCO.volume, volumedata$TMUS.volume, volumedata$LYB.volume)
colnames(tradingvol) <- c("DIS", "CSCO", "TMUS", "LYB")
m <- tail(tradingvol, n = 365)
dygraph(m, ylab = "Trading Volume (# of Shares)", group = "stocks") %>%
  dyOptions(strokeWidth = 2, colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
    dyHighlight(highlightCircleSize = 3, highlightSeriesBackgroundAlpha = 0.2, hideOnMouseOut = TRUE) %>%
      dyLegend(width = 400) %>%
        dyRangeSelector(dateWindow = c("2019-02-11", "2019-05-11"))
```

#Decision Summary

Column
-----------------------------------------------------------------------

The stocks shortlisted for investment were Disney (DIS), Cisco Systems (CSCO), T-Mobile US (TMUS) and Lyondell Basell (LYB). Various data points were gathered for a one year period (from 2018-05-11 to 2019-05-11) from Yahoo Finance.
The first tab "Stock Price View" contains candlestick charts for stock prices for each company. Disney's stocks seem to be doing well since mid-April 2019. Cisco's stocks seem to be falling slowly after it hit its highest peak. T-Mobile's stocks seem to be on the rise and is at its highest peak right now. Lyondell Basell's stocks seem to be falling sharply.
The second tab "Metrics Comparison" containts adjusted closing price and trading volumes across comparies over time. Disney, Cisco and T-Mobile seem to be having positive slopes for adjusted stock prices, while Lyondell Basell seems to be having a negative slope. Cisco, T-Mobile and Lyondell Basell seem to be having an average/steady change in trading volume, while Disney seems to be having an increase in trading volume.
In light of these visualizations-based findings and in anticipation of the launch of Disney+ in November 2019, I would recommend investing in Disney for short-term gains.