For this assignment, stock price of four companies (Google [GOOG], Meta [META], Amazon [AMZN], and Netflix [NFLX]) is visually analyzed over a period of six months. The data is extracted from Yahoo Finance for the time range from October 2022 till March 2023. A short time period is used for this task as I want to invest in short term time frame.
The first tab ‘Individual Stock Analysis’ provides a detailed visual analysis of the daily low and high, along with the daily open and close for all the four companies. The second tab ‘Trading Volumes’ provides a combined visualization of the daily trend in trading volumes for all the four companies. The third tab ‘Day Trading Analysis’ provides the daily high’s for all the four companies, which could be used for short term day trading analysis. Lastly, this tab outlines the analysis which could be used for making an informed decision.
Meta (META) and Netflix (NFLX) stock prices have increased significantly from the past six months, and for the short term investment perspective, it could be a profitable investment. Google (GOOG) has seen several fluctuations in its price but has somewhat remained at the same price range. Lastly, Amazon (AMZN) stock price has dropped significantly in the past six months and can be considered as a volatile investment. As of March 2023, the closing price for Netflix (NFLX) is the highest around $293, followed by Meta (META) at $199, Google (GOOG) at $104, and Amazon (AMZN) $102. Out of all the four companies, Amazon (AMZN) has the lowest daily trading volume but the trend is consistent compared to the other company’s trading volumes.
Based on the aforementioned points, investing in Amazon (AMZN) stock could be a profitable option. In second place, a split investment could be done for Meta (META) and Netflix (NFLX) stocks.
---
title: "Lab 1 - Dashboards & Dashboarding Theory [Finance]"
output:
flexdashboard::flex_dashboard:
orientation: columns
social: menu
source_code: embed
vertical_layout: fill
html_document:
df_print: paged
---
```{r setup, include = FALSE}
#knitr::opts_chunk$set(echo = TRUE)
#Load required libraries
library(dygraphs)
library(flexdashboard)
library(pdfetch)
library(xts)
#Create 'tickers' variable for the selected stocks
tickers = c("GOOG", "META", "AMZN", "NFLX")
```
**Individual Stock**
=====================================
Column {.tabset data-height=300}
-----------------------------------------------------------------------
### Google (GOOG)
```{r}
Google = pdfetch_YAHOO("GOOG", fields = c("open", "high", "low", "close"),
from = as.Date("2022-10-01"),
interval = "1d")
colnames(Google) = c("Open", "High", "Low", "Close")
#Candlestick plot
dygraph(Google,
ylab = "Stock Price ($)",
group = "stockprices") %>%
dyCandlestick() %>%
dyLegend(width = 200) %>%
dyRangeSelector()
```
### Meta (META)
```{r}
Meta = pdfetch_YAHOO("META", fields = c("open", "high", "low", "close"),
from = as.Date("2022-10-01"),
interval = "1d")
colnames(Meta) = c("Open", "High", "Low", "Close")
x = tail(Meta, n = 1500)
#Candlestick plot
dygraph(x,
ylab = "Stock Price ($)",
group = "stockprices") %>%
dyCandlestick() %>%
dyLegend(width = 200) %>%
dyRangeSelector()
```
### Amazon (AMZN)
```{r}
Amazon = pdfetch_YAHOO("AMZN", fields = c("open", "high", "low", "close"),
from = as.Date("2022-10-01"),
interval = "1d")
colnames(Amazon) = c("Open", "High", "Low", "Close")
x = tail(Amazon, n = 1500)
#Candlestick plot
dygraph(x,
ylab = "Stock Price ($)",
group = "stockprices") %>%
dyCandlestick() %>%
dyLegend(width = 200) %>%
dyRangeSelector()
```
### Netflix (NFLX)
```{r}
Netflix = pdfetch_YAHOO("NFLX", fields = c("open", "high", "low", "close"),
from = as.Date("2022-10-01"),
interval = "1d")
colnames(Netflix) = c("Open", "High", "Low", "Close")
x = tail(Netflix, n = 1500)
#Candlestick plot
dygraph(x,
ylab = "Stock Price ($)",
group = "stockprices") %>%
dyCandlestick() %>%
dyLegend(width = 200) %>%
dyRangeSelector()
```
**Trading Volumes**
=====================================
Column {.tabset data-height = 300}
-----------------------------------------------------------------------
### Trading Volumes for Google, Meta, Amazon, and Netflix
```{r}
fd = pdfetch_YAHOO(tickers,
fields = c("open", "high", "low", "close", "volume", "adjclose"),
from = as.Date("2022-10-01"),
interval = "1d")
tradeVolume = cbind(fd$META.volume, fd$AMZN.volume, fd$NFLX.volume, fd$GOOG.volume)
colnames(tradeVolume) = c("GOOG", "META", "AMZN", "NFLX")
dygraph(tradeVolume,
main = "Trading Volumes",
ylab = "Volume",
group = "trades") %>%
dyOptions(strokeWidth = 2, colors = RColorBrewer::brewer.pal(5, "Set2"))%>%
dyHighlight(highlightCircleSize = 3,
highlightSeriesBackgroundAlpha = 0.2,
hideOnMouseOut = TRUE)%>%
dyLegend(width = 400) %>%
dyRangeSelector()
```
**Day Trading**
=====================================
Column {.tabset data-height = 300}
-----------------------------------------------------------------------
### Day High's for Google, Meta, Amazon, and Netflix
```{r}
dayHigh = pdfetch_YAHOO(tickers,
fields = c("open", "high"),
from = as.Date("2022-10-01"),
interval = "1d")
high = cbind(dayHigh$META.high, dayHigh$AMZN.high, dayHigh$NFLX.high, dayHigh$GOOG.high)
colnames(high) = c("GOOG", "META", "AMZN", "NFLX")
dygraph(high,
main = "Day Trading Analysis for Short Term",
ylab = "Max value for a single day ($)",
group = "trades") %>%
dyOptions(strokeWidth = 2, colors = RColorBrewer::brewer.pal(5, "Set2"))%>%
dyHighlight(highlightCircleSize = 3,
highlightSeriesBackgroundAlpha = 0.2)%>%
dyLegend(width = 400) %>%
dyRangeSelector()
```
**Conclusion**
=====================================
For this assignment, stock price of four companies (Google [GOOG], Meta [META], Amazon [AMZN], and Netflix [NFLX]) is visually analyzed over a period of six months. The data is extracted from Yahoo Finance for the time range from October 2022 till March 2023. A short time period is used for this task as I want to invest in short term time frame.
The first tab 'Individual Stock Analysis' provides a detailed visual analysis of the daily low and high, along with the daily open and close for all the four companies. The second tab 'Trading Volumes' provides a combined visualization of the daily trend in trading volumes for all the four companies. The third tab 'Day Trading Analysis' provides the daily high's for all the four companies, which could be used for short term day trading analysis. Lastly, this tab outlines the analysis which could be used for making an informed decision.
Meta (META) and Netflix (NFLX) stock prices have increased significantly from the past six months, and for the short term investment perspective, it could be a profitable investment. Google (GOOG) has seen several fluctuations in its price but has somewhat remained at the same price range. Lastly, Amazon (AMZN) stock price has dropped significantly in the past six months and can be considered as a volatile investment. As of March 2023, the closing price for Netflix (NFLX) is the highest around $293, followed by Meta (META) at $199, Google (GOOG) at $104, and Amazon (AMZN) $102. Out of all the four companies, Amazon (AMZN) has the lowest daily trading volume but the trend is consistent compared to the other company's trading volumes.
Based on the aforementioned points, investing in Amazon (AMZN) stock could be a profitable option. In second place, a split investment could be done for Meta (META) and Netflix (NFLX) stocks.