Project Summary

Objective:

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 or commodities and determine which one of the four will produce the most short term gains. Use your imagination.

Approach:

I am considering investing in one of the four companies: Amazon (AMZN), American express (AXP), Capital One (COF) and Netflix(NFLX) . I collect data from Yahoo Finance and I will focus on the Stock Key Performance Metrics, historical stock closing price, and the historical Candlestick information when I make a quantitative decision.

Performance Metrics Analysis

Row

Definition of Indicators

  • P/E Ratio - The price-earnings ratio is the ratio of a company’s share price to earnings per share

    Analysing P/E ratio - Higher P/E ratio shows investors are willing to pay a higher share price today because of growth expectations in future.It can reveal how a stock’s valuation compares to its industry group or a benchmark like the S&P 500 index.

  • Price/EPS Estimate Next Year - Version of the (P/E) ratio that uses forecasted earnings for the next full-year fiscal (FY) period for the P/E calculation.

    Analysing Price/EPS Estimate Next Year - Analysts use earnings estimates to determine what the relative value of the company will be at a future level of earnings. The forward P/E estimates the relative value of the earnings.

  • Dividend Yield - The dividend per share, divided by the price per share

    Analysing Dividend Yield - The dividend yield is an estimate of the dividend-only return of a stock investment. Note that many stocks do not pay dividends.

  • Market Capitalization - The aggregate market value of a company represented in dollar amount. It is calculated by multiplying a company’s outstanding shares by the current market price of one share

    Analysing Market Capitalization - Market capitalization is the correct measure to look at, as it represents the true value a company’s actual worth as perceived by the overall market.

  • Earnings Per Share - A company’s profit divided by the outstanding shares of its common stock

    Analysing Earnings Per Share - It serves as an indicator of a company’s profitability. It shows how much money a company makes for each share of its stock.

Row

Stock Key Performance Metrics

Closing Prices

Row

Stock Closing Prices

[1] "AMZN" "AXP"  "COF"  "NFLX"

Row

Insights

This graph indicates that historically, neflix and amazon have closed at higher prices as compared to Amex and Capital one

Analysis of four stocks

Row

Amazon

[1] "AMZN"

American Express

[1] "AXP"

Row

Capital One

[1] "COF"

Netflix

[1] "NFLX"

Conclusion

---
title: "ANLY 512 Lab 1 - Dashboards and Financial Data"
output: 
  flexdashboard::flex_dashboard:
    orientation: row
    vertical_layout: fill
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
#install.packages("quantmod")
library(quantmod)
library(plyr)
#install.packages("DT")
library(DT)
#install.packages("dygraphs")
library(dygraphs)
#install.packages("xts")
library(xts)
#install.packages("tidyquant")
library(tidyquant)
library(tidyverse)
#library(ggplot2)
```

   


# Project Summary  {data-icon="fa-list"}

**Objective**:

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 or commodities and determine which one of the four will produce the most short term gains. Use your imagination.


**Approach**:

I am considering investing in one of the four companies:  Amazon (AMZN), American express (AXP), Capital One (COF) and Netflix(NFLX) . I collect data from Yahoo Finance and I will focus on the Stock Key Performance Metrics, historical stock closing price, and the historical Candlestick information when I make a quantitative decision.


# Performance Metrics Analysis {data-icon="fa fa-tachometer"}

Row
-----------------------------------------------------------------------

### Definition of Indicators

- **P/E Ratio** - The price-earnings ratio is the ratio of a company's share price to earnings per share

   **Analysing P/E ratio** - Higher P/E ratio shows  investors are willing to pay a higher share price today because                              of growth expectations in future.It can reveal how a stock's valuation compares to its                               industry group or a benchmark like the S&P 500 index.
  
- **Price/EPS Estimate Next Year** - Version of the (P/E) ratio that uses forecasted earnings for the next full-year                                      fiscal (FY) period for the P/E calculation.

    **Analysing Price/EPS Estimate Next Year ** - Analysts use earnings estimates to determine what the relative    value of the company will be at a future level of earnings. The forward P/E estimates the relative value of the earnings.

- **Dividend Yield** - The dividend per share, divided by the price per share

    **Analysing Dividend Yield** - The dividend yield is an estimate of the dividend-only return of a stock investment. Note that many stocks do not pay dividends. 

- **Market Capitalization** - The aggregate market value of a company represented in dollar amount. It is calculated by multiplying a company's outstanding shares by the current market price of one share

    **Analysing Market Capitalization ** - Market capitalization is the correct measure to look at, as it represents the true value  a company's actual worth as perceived by the overall market.

- **Earnings Per Share** - A company's profit divided by the outstanding shares of its common stock 

    **Analysing Earnings Per Share** - It serves as an indicator of a company's profitability. It shows how much   money a company makes for each share of its stock.

Row
-----------------------------------------------------------------------

### Stock Key Performance Metrics 


```{r}
what_metrics <- yahooQF(c("Price/Sales", 
                          "P/E Ratio",
                          "Price/EPS Estimate Next Year",
                          "PEG Ratio",
                          "Dividend Yield", 
                          "Market Capitalization",
                           "Earnings/Share"))

tickers <- c("AMZN", "AXP", "COF", "NFLX")
# Not all the metrics are returned by Yahoo.
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=what_metrics)

#Add tickers as the first column and remove the first column which had date stamps
metrics <- data.frame(Symbol=tickers, metrics[,2:length(metrics)]) 

#Change colnames
colnames(metrics) <- c("Symbol", "P-E Ratio", "Price EPS Estimate Next Year", "Div Yield", "Market Cap", "Earnings per Share")

#Export financial stock key performance metrics to a csv file
write.csv(metrics, "FinancialMetrics.csv", row.names=FALSE)
DT::datatable(metrics)
```

## Column {.sidebar}

### Insights

Looking at P/E ratio of the four companies, it can be ascertained that Netflix and Amazon are the most overvalued companies. There is a high chance that it will see a price correction to match more with its earnings in the short term. On the other hand, COF and AMX have relatively low P/E indicating them as good investments 

# Closing Prices {data-icon="ion-arrow-graph-up-right"}

Row {data-height=200}
-------------------------
### Stock Closing Prices

```{r}
getSymbols(tickers, from="2017-01-01", to="2019-10-01")
ClosingPrices <- do.call(merge, lapply(tickers, function(x) Cl(get(x))))
dateperiod<-c("2017-01-01", "2019-10-01")
dygraph(ClosingPrices, main="Closing Price in Dollars", group="Stock") %>%
  dyAxis("y", label="Closing Price(USD)") %>%
  dyOptions(axisLineWidth = 1.5,  colors = RColorBrewer::brewer.pal(5, "Set1")) %>%
  dyHighlight(highlightSeriesBackgroundAlpha = 1.0, highlightSeriesOpts = list(strokeWidth = 3)) %>%
  dyRangeSelector(height = 50)
```

Row {data-height=200}
-------------------------
### Insights

This graph indicates that historically, neflix and amazon have closed at higher prices as compared to Amex and Capital one


# Analysis of four stocks {data-icon="fa-signal"}

Row
-----------------------------------------------------------------------

### Amazon

```{r}
getSymbols("AMZN", src = "yahoo", from='2019-05-01', to= '2019-12-15')
AMZN_x <- AMZN
dygraph(AMZN_x[, -5], main = "AMZN") %>%
  dyCandlestick() %>%
  dyAxis("y", label="Daily Stock Closing Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set1")) %>%
  dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5), highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 60)
```

### American Express

```{r}
getSymbols("AXP", src = "yahoo", from='2019-05-01', to= '2019-12-15')
AXP_x <- AXP
dygraph(AXP_x[, -5], main = "AXP") %>%
  dyCandlestick() %>%
  dyAxis("y", label="Daily Stock Closing Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set1")) %>%
  dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5), highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 60)

```

Row
-----------------------------------------------------------------------

### Capital One

```{r}
getSymbols("COF", src = "yahoo", from='2019-05-01', to= '2019-12-15')
COF_x <- COF
dygraph(COF_x[, -5], main = "COF") %>%
  dyCandlestick() %>%
  dyAxis("y", label="Daily Stock Closing Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set1")) %>%
  dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5), highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 60)
```

### Netflix

```{r}
getSymbols("NFLX", src = "yahoo", from='2019-05-01',to= '2019-12-15')
NFLX_x <- NFLX
dygraph(NFLX_x[, -5], main = "NFLX") %>%
  dyCandlestick() %>%
  dyAxis("y", label="Daily Stock Closing Price") %>%
  dyOptions(colors= RColorBrewer::brewer.pal(5, "Set1")) %>%
  dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5), highlightSeriesBackgroundAlpha = 1) %>%
  dyRangeSelector(height = 60)
```

# Conclusion {data-icon="fa-list"}

- Looking at P/E ratio of the four companies, it can be ascertained that Netflix and Amazon are the most overvalued companies. There is a high chance that it will see a price correction to match more with its earnings in the short term. On the other hand, COF and AMX have relatively low P/E indicating them as good investments 

- Recent trends show that COF prices hhave seen a major jump in past few months. Such jumps, if not corroborated any higher earnings indicate regression to the mean in coming months. Hence COF can be ruled out for shot term investment 

- American express looks like most favore investment vehicle given its low P/E ratio and relatively stable price in the near past