Introduction

Column

Overview

Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to conduct analyses or create tools to support quantitative decision making.

A principle tool used in industry, government, non-profits, and academic fields to compensate for the information overload is the information dashboard. Functionally, a dashboard is meant to provide a user with a central resource to present in a clear and concise manner all the information necessary to support day-to-day decision making and support operations.

Column

Objective

The objective of this laboratory is to plan, design, and create an information dashboard to support quantitative decision making. To accomplish this task you will have to complete a number of steps:

  • Identify what information will be relevant to decision making.
  • Find and collect the data necessary to create your visualization plan.
  • Organize and summarize the collected data.
  • Design and create the best visualizations to present that information.
  • Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that conforms to the theory of dashboarding.
  • Write a summary about what decisions you made based on the visualizations that you developed.

Column

The Task

You make investments for an organization, your objective is to purchase securities/commodities for the key objective of maximizing profits. You want to make an investment in securities/commodities to make some short term gains. You are considering investing in one of any four companies, for example: Twitter (TWTR), Microsoft (MSFT), or Apple (AAPL) (don’t use these).

Choose 4 companies, commodities or any financial instrument you like, and determine which one of the four will produce the most short term gains. Use your imagination.

Stock Prices

Column

Facebook

Google

Netflix

Amazon

Trading Volumes

Trading Volumes for Google, Facebook, Netflix and Amazon

[1] "AMZN" "META" "NFLX" "GOOG"

Financial Indicators

Finanical Metrics

P-E Ratio - It is a way to value a company by comparing the price of a stock to its earnings. It tells you how much you are paying for each dollar of earning.

Earnings Per Share (EPS) - indicates how much money a company makes for each share of its stock and is a widely used metric for estimating corporate value. A higher EPS indicates greater value because investors will pay more for a company’s shares if they think the company has higher profits relative to its share price.

Dividend Yield Ratio - is a financial ratio that shows how much a company pays out in dividends each year relative to its stock price.

Market Cap - the total value of a company’s shares of stock.

Key Indicator Analysis

Conclusion

Conclusion

This dashboard consists of data analyzed for the full 2022 year for 4 companies - Google, Facebook, Amazon and Netflix. I sourced the data from Yahoo Finance using R codes.

This second tab (Stock Prices) provides a graphical representation of the daily open and closing stock prices, along with the daily low and high for each of the 4 companies. We see here that Facebook, Netflix and Amazon have high stocks that fluctuate in Billions while Google fluctuates in Millions. Comparatively Amazon has a positive sustainable look over the long-term, followed by Facebook.

The third tab (Trading Volumes) compares the trends in trading volumes of all the 4 companies. Focusing on the closing out of the year, i.e. Nov and Dec 2022, Facebook and Amazon had high trading volumes. This shows that there was a high level of investor interest during those periods which can be a indication of positive sentiment about the company’s future prospects. It also means the stock is more liquid and easier to buy and sell, making it more attractive to investors.

The fourth tab (Financial Indicators) provides information on important basic key terms to measure in the stock market. This tab had a bit conflicting results to be able to firmly choose one of the companies, but we can see Netflix has a high amount we would be paying for each dollar so might want to steer away from that. Amazon had the highest EPS indicating greater value over it’s competitors.

Overall, based on all the information, I think investing into Amazon would be an ideal and safe choice for short term gains followed by Facebook.

---
title: "ANLY 512, Lab 1 by Apoorva Grover"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    social: menu 
    source: embed
---

# Introduction 
## Column 
### Overview 

Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to conduct analyses or create tools to support quantitative decision making.

A principle tool used in industry, government, non-profits, and academic fields to compensate for the information overload is the information dashboard. Functionally, a dashboard is meant to provide a user with a central resource to present in a clear and concise manner all the information necessary to support day-to-day decision making and support operations. 

## Column
### Objective 
The objective of this laboratory is to plan, design, and create an information dashboard to support quantitative decision making. To accomplish this task you will have to complete a number of steps:

- Identify what information will be relevant to decision making.
- Find and collect the data necessary to create your visualization plan.
- Organize and summarize the collected data.
- Design and create the best visualizations to present that information.
- Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that conforms to the theory of dashboarding.
- Write a summary about what decisions you made based on the visualizations that you developed.

## Column 
### The Task 
You make investments for an organization, your objective is to purchase securities/commodities for the key objective of maximizing profits. You want to make an investment in securities/commodities to make some short term gains. You are considering investing in one of any four companies, for example: Twitter (TWTR), Microsoft (MSFT), or Apple (AAPL) (don’t use these). 

Choose 4 companies, commodities or any financial instrument you like, and determine which one of the four will produce the most short term gains. Use your imagination.

# Stock Prices 

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


### Facebook

```{r}
library("quantmod")
library("dygraphs")

# Download data from Yahoo Finance
FB <- quantmod:::getSymbols.yahoo("META", src = "yahoo", from = "2022-01-01", to = "2022-12-31", auto.assign = FALSE)

# Convert data to a data frame
FB_df <- data.frame(Date = index(FB), FB)

# Create dygraph with candlestick chart
dygraph(FB_df, main = "Facebook Stock Prices") %>%
  dyCandlestick() %>%
  dyRangeSelector() %>%
  dyLegend(width = 250)

```


### Google

```{r}
library("quantmod")
library("dygraphs")

# Download data from Yahoo Finance
Google <- quantmod:::getSymbols.yahoo("GOOG", src = "yahoo", from = "2022-01-01", to = "2022-12-31", auto.assign = FALSE)

# Convert data to a data frame
Google_df <- data.frame(Date = index(Google), Google)

# Create dygraph with candlestick chart
dygraph(Google_df, main = "Google Stock Prices") %>%
  dyCandlestick() %>%
  dyRangeSelector() %>%
  dyLegend(width = 250)

```

### Netflix 

```{r}
library("quantmod")
library("dygraphs")

# Download data from Yahoo Finance
Netflix <- quantmod:::getSymbols.yahoo("NFLX", src = "yahoo", from = "2022-01-01", to = "2022-12-31", auto.assign = FALSE)

# Convert data to a data frame
Netflix_df <- data.frame(Date = index(Netflix), Netflix)

# Create dygraph with candlestick chart
dygraph(Netflix_df, main = "Netflix Stock Prices") %>%
  dyCandlestick() %>%
  dyRangeSelector() %>%
  dyLegend(width = 250)


```
### Amazon
```{r}
library("quantmod")
library("dygraphs")

# Download data from Yahoo Finance
Amazon <- quantmod:::getSymbols.yahoo("AMZN", src = "yahoo", from = as.Date("2022-01-01"), to = as.Date("2022-12-31"), auto.assign = FALSE)

# Convert data to a data frame
Amazon_df <- data.frame(Date = index(Amazon), Amazon)

# Create dygraph with candlestick chart
dygraph(Amazon_df, main = "Amazon Stock Prices") %>%
  dyCandlestick() %>%
  dyRangeSelector() %>%
  dyLegend(width = 250)

```


# Trading Volumes

### Trading Volumes for Google, Facebook, Netflix and Amazon

```{r}
library(quantmod)

# Define the stock symbols and start date
symbols <- c("AMZN", "META", "NFLX", "GOOG")
start_date <- as.Date("2022-01-01")
end_date <- as.Date("2022-12-31")

# Download the data using getSymbols()
getSymbols(symbols, src = "yahoo", from = start_date)

# Extract the desired columns from the data
financialData <- data.frame(
  AMZN.Open = AMZN$AMZN.Open,
  AMZN.High = AMZN$AMZN.High,
  AMZN.Low = AMZN$AMZN.Low,
  AMZN.Close = AMZN$AMZN.Close,
  AMZN.Volume = AMZN$AMZN.Volume,
  AMZN.Adjusted = AMZN$AMZN.Adjusted,
  META.Open = META$META.Open,
  META.High = META$META.High,
  META.Low = META$META.Low,
  META.Close = META$META.Close,
  META.Volume = META$META.Volume,
  META.Adjusted = META$META.Adjusted,
  NFLX.Open = NFLX$NFLX.Open,
  NFLX.High = NFLX$NFLX.High,
  NFLX.Low = NFLX$NFLX.Low,
  NFLX.Close = NFLX$NFLX.Close,
  NFLX.Volume = NFLX$NFLX.Volume,
  NFLX.Adjusted = NFLX$NFLX.Adjusted,
  GOOG.Open = GOOG$GOOG.Open,
  GOOG.High = GOOG$GOOG.High,
  GOOG.Low = GOOG$GOOG.Low,
  GOOG.Close = GOOG$GOOG.Close,
  GOOG.Volume = GOOG$GOOG.Volume,
  GOOG.Adjusted = GOOG$GOOG.Adjusted
)

# Extract the volume columns from financialData
trade_vol <- cbind(financialData[, c("AMZN.Volume", "META.Volume", "NFLX.Volume", "GOOG.Volume")])

# Rename the columns
colnames(trade_vol) <- c("AMZN", "META", "NFLX", "GOOG")

x <- tail(trade_vol, n = 1500)

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

# Financial Indicators

```{r}
library("kableExtra")

```

### Finanical Metrics 
\n`r kableExtra::text_spec("**P-E Ratio**", color = "#5c5c5c")` - It is a way to value a company by comparing the price of a stock to its earnings. It tells you how much you are paying for each dollar of earning. 

\n`r kableExtra::text_spec("**Earnings Per Share (EPS)**", color = "#5c5c5c")` - indicates how much money a company makes for each share of its stock and is a widely used metric for estimating corporate value. A  higher EPS indicates greater value because investors will pay more for a company's shares if they think the company has higher profits relative to its share price.

\n`r kableExtra::text_spec("**Dividend Yield Ratio**", color = "#5c5c5c")` - is a financial ratio that shows how much a company pays out in dividends each year relative to its stock price.

\n`r kableExtra::text_spec("**Market Cap**", color = "#5c5c5c")` - the total value of a company's shares of stock.

### Key Indicator Analysis

```{r}
library(quantmod)
library(dygraphs)
library(plyr)
library(DT)
library(dplyr)
library(highcharter)
library(viridisLite)
library(ggplot2)
library(broom)
library(xts)
library(zoo)
library(httr)
library(jsonlite)

what_metrics <- yahooQF(c("Price/Sales", 
                          "P/E Ratio",
                          "Price/EPS Estimate Next Year",
                          "PEG Ratio",
                          "Dividend Yield", 
                          "Market Capitalization"))
tickers <- c("META", "GOOG", "AMZN", "NFLX")
metrics <- getQuote(paste(tickers, sep = ",", collapse = ";"), what = what_metrics)
metrics <- data.frame(Symbol = tickers, metrics[,2:length(metrics)])
colnames(metrics) <- c("Symbol", "P-E Ratio", "EPS", "Dividend Yield Ratio", "Market Cap")
DT::datatable(metrics)

```


# Conclusion 
### Conclusion 

This dashboard consists of data analyzed for the full 2022 year for 4 companies - Google, Facebook, Amazon and Netflix. I sourced the data from Yahoo Finance using R codes. 

This second tab (Stock Prices) provides a graphical representation of the daily open and closing stock prices, along with the daily low and high for each of the 4 companies.  We see here that Facebook, Netflix and Amazon have high stocks that fluctuate in Billions while Google fluctuates in Millions. Comparatively Amazon has a positive sustainable look over the long-term, followed by Facebook. 

The third tab (Trading Volumes) compares the trends in trading volumes of all the 4 companies. Focusing on the closing out of the year, i.e. Nov and Dec 2022, Facebook and Amazon had high trading volumes. This shows that there was a high level of investor interest during those periods which can be a indication of positive sentiment about the company's future prospects. It also means the stock is more liquid and easier to buy and sell, making it more attractive to investors.  

The fourth tab (Financial Indicators) provides information on important basic key terms to measure in the stock market. This tab had a bit conflicting results to be able to firmly choose one of the companies, but we can see Netflix has a high amount we would be paying for each dollar so might want to steer away from that. Amazon had the highest EPS indicating greater value over it's competitors. 

Overall, based on all the information, I think investing into Amazon would be an ideal and safe choice for short term gains followed by Facebook.