Stock Prices

Column

MSFT Microsoft (MSFT)

Texas Instruments Incorporated (TXN)

Amazon (AMZN)

Intuitive Surgical, Inc.(ISRG)

Adjusted Closing Prices

Column

Adjusted Closing Prices for Microsoft (MSFT), Texas Instruments Incorporated (TXN), Amazon (AMZN) and Intuitive Surgical, Inc. (ISRG)

Trading Volume

Column

Trading Volume for Microsoft (MSFT), Texas Instruments Incorporated (TXN), Amazon (AMZN) and Intuitive Surgical, Inc. (ISRG)

Summary

Column

We analyzed one year of financial data for 4 companies- Microsoft (MSFT), Texas Instruments Incorporated (TXN), Amazon (AMZN) and Intuitive Surgical, Inc. (ISRG). The data was sourced from Yahoo Finance and the time period of the data is from January 2022 to January 2023.

Stock Prices tab provides a graphical representation of the daily open and closing stock prices, along with the daily low and high for all 4 companies.

Adjusted Closing Prices tab compares the closing stock prices of all the 4 companies.

Trading Volumes tab compares the trends in trading volumes of all the 4 companies.

Microsofts’ stock prices were on a downward trend last year and the low stock prices continues into 2023; Amazon is facing the same trend. Both Texas Instruments Incorporated and Intuitive Surgical, Inc.’s stock prices remain relatively consistent despite of its ups and downs in the past year.

In 2022, Microsoft’s adjusted closing price consistently stayed very high as well as Intuitive Surgical, Inc. While Texas Instruments Incorporated had a consistently higher closing price above Amazon

Intuitive Surgical, Inc’s trading volumes are the lowest among the four companies, while Amazon’s trading volumes surpassed others.

Considering this, we recommend investing in Texas Instruments Incorporated since it’s stock price and adjusted closing prices are relatively consistent compared to others last year. Although its trading volume is on the lower end, it remains similar Month Over Month in 2022 without much fluctuation like others. Amazon can be the second choice considering its high trading volume and the growth in stock prices.

---
title: "Lab 1 - Group Project"

output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
    vertical_layout: fill
  html_document:
    df_print: paged

---    
Stock Prices
=====================================


```{r}

chooseCRANmirror(graphics=FALSE, ind=1)
#install.packages("flexdashboard")
library("flexdashboard")
#install.packages("pdfetch")
library("pdfetch")
#install.packages("dygraphs")
library("dygraphs")
#install.packages("xts")
library("xts")
identifiers <- c("MSFT", "TXN", "AMZN", "ISRG")
```

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

### MSFT Microsoft (MSFT)

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

x<- tail(MSFT, n=1500)

#plot
library("dygraphs")

dygraph(x,ylab = "Stock Price ($)", group = "stockprices") %>%
dyAxis("x", label = "Month and year") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>%
dyRangeSelector()
```
### Texas Instruments Incorporated (TXN)


```{r}

TXN <- pdfetch_YAHOO("TXN", fields = c("open", "high", "low", "close"), from = as.Date("2022-01-26"), interval = "1d")
colnames(TXN)=c("Open", "High","Low","Close")

x<- tail(TXN, n=1500)

#plot
library("dygraphs")

dygraph(x,ylab = "Stock Price ($)", group = "stockprices") %>%
dyAxis("x", label = "Month and year") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>%
dyRangeSelector()

```
### Amazon (AMZN)

```{r}

AMZN <- pdfetch_YAHOO("AMZN", fields = c("open", "high", "low", "close"), from = as.Date("2022-01-26"), interval = "1d")
colnames(AMZN)=c("Open", "High","Low","Close")

x<- tail(AMZN, n=1500)

#plot
library("dygraphs")

dygraph(x,ylab = "Stock Price ($)", group = "stockprices") %>%
dyAxis("x", label = "Month and year") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>%
dyRangeSelector()

```

### Intuitive Surgical, Inc.(ISRG)

```{r}

ISRG <- pdfetch_YAHOO("ISRG", fields = c("open", "high", "low", "close"), from = as.Date("2022-01-26"), interval = "1d")
colnames(ISRG)=c("Open", "High","Low","Close")

x<- tail(ISRG, n=1500)

#plot
library("dygraphs")

dygraph(x,ylab = "Stock Price ($)", group = "stockprices") %>%
dyAxis("x", label = "Month and year") %>%
dyCandlestick() %>%
dyLegend(width = 400) %>%
dyRangeSelector()

```

  
Adjusted Closing Prices
=====================================

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

### Adjusted Closing Prices for Microsoft (MSFT), Texas Instruments Incorporated (TXN), Amazon (AMZN) and Intuitive Surgical, Inc. (ISRG)

```{r}

financialData <- pdfetch_YAHOO(identifiers, fields = c("open","adjclose"), from = as.Date("2022-01-26"), interval = "1d")

Adj_close <- cbind(financialData$MSFT.adjclose,financialData$TXN.adjclose, financialData$AMZN.adjclose, financialData$ISRG.adjclose)
colnames(Adj_close) <- c("MSFT", "TXN", "AMZN", "ISRG")

x <- tail(Adj_close, n = 1500)

dygraph(x,
        main = "Adjusted Closing Price", 
        ylab = "Closing Price ($)",
        group = "trading") %>%
dyAxis("x", label = "Month and year") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set2"))%>%
dyHighlight(highlightCircleSize = 3, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = TRUE)%>%
dyLegend(width = 400) %>%
dyRangeSelector()
```


Trading Volume
=====================================

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

### Trading Volume for Microsoft (MSFT), Texas Instruments Incorporated (TXN), Amazon (AMZN) and Intuitive Surgical, Inc. (ISRG)

```{r}

financialData <- pdfetch_YAHOO(identifiers, fields = c("open", "high", "low", "close","volume","adjclose"), from = as.Date("2022-01-26"),interval = "1d")

Trade_vol <- cbind(financialData$MSFT.volume,financialData$TXN.volume, financialData$AMZN.volume, financialData$ISRG.volume)
colnames(Trade_vol) <-c("MSFT", "TXN", "AMZN", "ISRG")

x <- tail(Trade_vol, n = 1500)

dygraph(x,
        main = "Trading Volume", 
        ylab = "Volume",
        group = "trading") %>%
dyAxis("x", label = "Month and year") %>%
dyOptions(strokeWidth = 2,colors = RColorBrewer::brewer.pal(5, "Set2"))%>%
dyHighlight(highlightCircleSize = 3, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = TRUE)%>%
dyLegend(width = 400) %>%
dyRangeSelector()
```

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


Column {data-width=600}
-------------------------------------
###
We analyzed one year of financial data  for 4 companies- Microsoft (MSFT), Texas Instruments Incorporated (TXN), Amazon (AMZN) and Intuitive Surgical, Inc. (ISRG). The data was sourced from Yahoo Finance and the time period of the data is from January 2022 to January 2023.

Stock Prices tab provides a graphical representation of the daily open and closing stock prices, along with the daily low and high for all 4 companies.

Adjusted Closing Prices tab compares the closing stock prices of all the 4 companies. 

Trading Volumes tab compares the trends in trading volumes of all the 4 companies. 

Microsofts' stock prices were on a downward trend last year and the low stock prices continues into 2023; Amazon is facing the same trend. Both Texas Instruments Incorporated and Intuitive Surgical, Inc.'s stock prices remain relatively consistent despite of its ups and downs in the past year.

In 2022, Microsoft's adjusted closing price consistently stayed very high as well as Intuitive Surgical, Inc. While Texas Instruments Incorporated had a consistently higher closing price above Amazon

Intuitive Surgical, Inc's trading volumes are the lowest among the four companies, while Amazon's trading volumes surpassed others.

Considering this, we recommend investing in Texas Instruments Incorporated since it's stock price and adjusted closing prices are relatively consistent compared to others last year. Although its trading volume is on the lower end, it remains similar Month Over Month in 2022 without much fluctuation like others. Amazon can be the second choice considering its high trading volume and the growth in stock prices.