Stock Prices

Column

JPMorgan Chase & Co. (JPM)

The Goldman Sachs Group, Inc. (GS)

Morgan Stanley (MS)

Citigroup Inc. (C)

Adjusted Closing & Trading Volume Comparison

Column

Adjusted Closing Price

Trading Volume

Summary

Column

This dashboard represents stock price information for four banking companies - JP Morgan Chase, The Goldman Sachs Group Inc., Morgan Stanley, Citigroup Inc. For stock analysis, last 2 year finance data of these companies has been extracted from Yahoo finance.
Dashboard has three tabs
1. Stock Prices : This tab represents last 2 years stock prices for all four companies where Open, High, Low, CLose Stock prices are represented by different colors.
2. Adjusted Closing & Trading Volume Comparision : This tab having two visualization to show a comparision of four companies’ Adjusted Closing and Trading Volume.
3. Summary : This tab summarize dashboard information.

JP Morgan Chase’s Stock prices is always more than $100 however for few months it went down but again it is going high since Oct’19. There was a huge drop in The Goldman Sachs Group Inc. Stock Prices during Jan’19, after which prices got little stablized but still stock prices are less as compare to last 2 year data. Same applies to Morgan Stanley, significant drop during Jan’19 and now stock pricess are getting higher but prices are still low as compare to last 2 year data. Citigroup Inc. stocks also growing.

Also, Goldman Sachs has highest Adjusted Closing Price among all, but on comparing last 2 years data we can see it went down as compare to last year. JP Morgan Chase is growing as compare to last year. Coming to Trading Volumne, Citigroup beats other companies and JP Morgan Chase is in competition with Citigroup.

JP Morgan Chase stock prices, adjusted closing prices and trading volumes are more stable, consistent and growing as compare to other companies Considering which, I would recommend to invest in JP Morgan Chase.


---
title: "ANLY 512-LAB 1"
author: "Anurag Gupta"
date: "`r Sys.Date()`"
output:
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
    vertical_layout: fill
    css: styles.css
  html_document:
    df_print: paged
---    


Stock Prices
=====================================


```{r setup, include=FALSE}
chooseCRANmirror(graphics=FALSE, ind=1)
library(flexdashboard)
library(pdfetch)
library(dygraphs)
library(xts)
```

Column {.tabset data-height=550}
-----------------------------------------------------------------------

### JPMorgan Chase & Co. (JPM)

```{r}
JPMC <- pdfetch_YAHOO("JPM", fields = c("open", "high", "low", "close"), from = as.Date("2018-01-01"),interval = "1d")
colnames(JPMC)=c("Open","High","Low","Close")

jpmcData <- tail(JPMC, n = 1500)

# Dy Graph for JPMC Stock Price 
dygraph(jpmcData,main = "Stock Price of JPMorgan Chase & Co. for Last 2 Year (in USD)") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>% dyAxis("y", label="Stock Price") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
dyRangeSelector(dateWindow = c("2018-01-01", "2019-12-31"))
```

### The Goldman Sachs Group, Inc. (GS)

```{r}
GS <- pdfetch_YAHOO("GS", fields = c("open", "high", "low", "close"), from = as.Date("2018-01-01"),interval = "1d")
colnames(GS)=c("Open","High","Low","Close")

gsData <- tail(GS, n = 1500)

# Dy Graph for Goldman Sachs Stock Price 
dygraph(gsData,main = "Stock Price of The Goldman Sachs Group, Inc. for Last 2 Year (in USD)") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>% dyAxis("y", label="Stock Price") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
dyRangeSelector(dateWindow = c("2018-01-01", "2019-12-31"))
```

### Morgan Stanley (MS)

```{r}
MS <- pdfetch_YAHOO("MS", fields = c("open", "high", "low", "close"), from = as.Date("2018-01-01"),interval = "1d")
colnames(MS)=c("Open","High","Low","Close")

msData <- tail(MS, n = 1500)

# Dy Graph for Goldman Sachs Stock Price 
dygraph(msData,main = "Stock Price of Morgan Stanley for Last 2 Year (in USD)") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>% dyAxis("y", label="Stock Price") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
dyRangeSelector(dateWindow = c("2018-01-01", "2019-12-31"))
```

### Citigroup Inc. (C)

```{r}
CITI <- pdfetch_YAHOO("C", fields = c("open", "high", "low", "close"), from = as.Date("2018-01-01"),interval = "1d")
colnames(CITI)=c("Open","High","Low","Close")

citiData <- tail(CITI, n = 1500)

# Dy Graph for Goldman Sachs Stock Price 
dygraph(citiData,main = "Stock Price of Citigroup Inc. for Last 2 Year (in USD)") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>% dyAxis("y", label="Stock Price") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set2")) %>%
dyRangeSelector(dateWindow = c("2018-01-01", "2019-12-31"))
```

Adjusted Closing & Trading Volume Comparison
===================================== 

Column { data-height=600}
-----------------------------------------------------------------------


### Adjusted Closing Price
```{r}
identifiers <- c("JPM", "GS", "MS", "C")
adjClPrData <- pdfetch_YAHOO(identifiers, fields = c("open","adjclose"), from = as.Date("2018-01-01"), to = as.Date("2019-12-31"),interval = "1d")

ClPrData <- cbind(adjClPrData$JPM.adjclose,adjClPrData$GS.adjclose, adjClPrData$MS.adjclose,adjClPrData$C.adjclose)
colnames(ClPrData) <-c("JPM","GS","MS","C")
#plot
dygraph(ClPrData, main = "Adjusted Closing Price for Last 2 Years") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set1"))%>%
dyHighlight(highlightCircleSize = 3, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = TRUE)%>%
dyLegend(width = 400) %>%dyAxis("y", label="Adjusted Closing Price") %>%
dyRangeSelector(dateWindow = c("2018-01-01", "2019-12-31"))
```

### Trading Volume
```{r}

trVolData <- pdfetch_YAHOO(identifiers, fields = c("open", "high", "low", "close","volume","adjclose"), from = as.Date("2018-01-01"), to = as.Date("2019-12-31"),interval = "1d")
trdVol <- cbind(trVolData$JPM.volume,trVolData$GS.volume, trVolData$MS.volume,trVolData$C.volume)
colnames(trdVol) <-c("JPM","GS","MS","C")
#plot
dygraph(trdVol, main = "Trading Volume for Last 2 Year") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set1"))%>%
dyHighlight(highlightCircleSize = 3, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = TRUE)%>%
dyLegend(width = 400) %>% dyAxis("y", label="Trading Volume") %>%
dyRangeSelector(dateWindow = c("2018-01-01", "2019-12-31"))
```


Summary 
=====================================


Column {data-width=600}
-------------------------------------

###

This dashboard represents stock price information for four banking companies - JP Morgan Chase, The Goldman Sachs Group Inc., Morgan Stanley, Citigroup Inc.
For stock analysis, last 2 year finance data of these companies has been extracted from Yahoo finance.\
Dashboard has three tabs\
1. Stock Prices :  This tab represents last 2 years stock prices for all four companies where Open, High, Low, CLose Stock prices are represented by different colors.\
2. Adjusted Closing & Trading Volume Comparision :  This tab having two visualization to show a comparision of four companies' Adjusted Closing and Trading Volume.\
3. Summary :  This tab summarize dashboard information.

JP Morgan Chase's Stock prices is always more than $100 however for few months it went down but again it is going high since Oct'19.
There was a huge drop in The Goldman Sachs Group Inc. Stock Prices during Jan'19, after which prices got little stablized but still stock prices
are less as compare to last 2 year data. Same applies to Morgan Stanley, significant drop during Jan'19 and now stock pricess are getting 
 higher but prices are still low as compare to last 2 year data. Citigroup Inc. stocks also growing.

Also, Goldman Sachs has highest Adjusted Closing Price among all, but on comparing last 2 years data we can see it went down as compare to last year.
JP Morgan Chase is growing as compare to last year. Coming to Trading Volumne, Citigroup beats other companies and JP Morgan Chase is in competition with Citigroup.

JP Morgan Chase stock prices, adjusted closing prices and trading volumes are more stable, consistent and growing as compare to other companies 
Considering which, I would recommend to invest in JP Morgan Chase.