Hi Prof. Hitch,
Since I am doing quantitative finance and Market/Credit Risk management, so I make this project more realtive to my working experience, close to capital market. I aso remembered you mentioned that we can choose to make project related to work, also kind of good way to demonstrate this analytic skill-set related to job content.
Actaully start from Lab1, I am trying to build up this project-Equity Risk Dashboard from following three perspective:
Performance: Cumulative returns is an good measure to evaluate whether certain Stock/Equity worth holding, buying or selling.
Sensitivity: Beta is used in the Capital Asset Pricing model (CAPM), which calculates the expected return of an asset using beta and expected market returns. We also call Beta is the sensitivity to benchmark performance.
Drawdowns: A drawdown is a peak-to-trough decline during a specific period for an investment, trading account, or fund. A drawdown is usually quoted as the percentage between the peak and the subsequent trough. If a trading account has $10,000 in it, and the funds drop to $9,000 before moving back above $10,000, then the trading account witnessed a 10% drawdown.
Following four Equity/Stock were in my portfolio:
EDU: From 2009-01-02 to 2019-11-02
BABA: From 2014-09-19 to 2019-11-02
IQ: From 2018-03-29 to 2019-11-02
SOGO: From 2017-10-26 to 2019-11-02
Conclusion:
Here are four Equity I’ve invested since Jan 2015: EDU (The best eduation & training instituion in China), BABA(No need to introduce more, everyone knows Alibaba and Jack Ma), IQ (The best online video stream in China) and SOGO (the most famous on SOGO Pinyin typing). The reason I am investing into because I use literally their products everyday, so holding promising on their future. Cumulative returns is an good measure to evaluate whether certain stock worth holding, buying or selling. S&P 500 Index is selected as Beanchmark becasue all of them are listed equity in U.S.
We will see that EDU is not beating the S&P 500 Index in terms of cumulative return for the past decade (From 2009-01-02 to 2019-11-02).But if you could invest into right after the muddy water event for EDU, then you also can obtain pretty decent capital gain.
For BABA, without any doubt, it beats S&P 500 Index in terms of cumulative return since IPO (2014-09-19) up to 2019-11-02.
For IQ, if you could buy in right after IPO 2018-03-29 with large volume, then sold out within first three months, you would definitely already be millionaire.
SOGO, I kind of regret that I never sell it around 2018-7 where it was firt time marked high. Not quite sure why investor are shorting this stock, their typing products are really good. But right now, seems like it would take a long way to back to where it was on IPO.
Conclusion:
Beta is used in the Capital Asset Pricing model (CAPM), which calculates the expected return of an asset using beta and expected market returns.
We also call Beta is the sensitivity to benchmark performance, from regressoin chart we can see that EDU is not that sensitive (Normal beta range from -2 to 2 in the long term run, but for some lately IPO stock, we will see crazy high beta)
Beta for BABA and IQ are much higher, which also confirm with their performance on the first tab. IQ has the highest beta among these four stocks.
I am kind of surprised that beta for SOGO to S&P 500 can be a postive value, hopefully I didn’t plot regression chart wrong given its poor cumulative performance.
Conclusion:
A drawdown is a peak-to-trough decline during a specific period for an investment, trading account, or fund. A drawdown is usually quoted as the percentage between the peak and the subsequent trough. If a trading account has $10,000 in it, and the funds drop to $9,000 before moving back above $10,000, then the trading account witnessed a 10% drawdown.
A stock’s total volatility is measured by its standard deviation, yet many investors, especially retirees who are withdrawing funds from pensions and retirement accounts, are mostly concerned about drawdowns. Volatile markets and large drawdowns can be problematic for retirees. Many look at the drawdown of their investments, from stocks to mutual funds, and consider their maximum drawdown (MDD) so they can potentially avoid those investments with the biggest historical drawdowns.
Obviously, EDU is the best investment in the long term I have been investing ever in terms of the only one short period max drawdown
BABA has three kind of big drawdown period, but if you are holding in long term it is stil a good investment
IQ, again if you can invest from it just IPO and sell them out before the max drawdown, you are the winner of lie. You are probably earning some quick money in that short period before June 2018.
SOGO, my worst investment ever in terms of drawdown period. I could have ever got a chance to sell it when just recover around June 2018, but I did not. Since then it is in deep drawdown, I never hold the hope that SOSO can recover… BUt still very good SOGO Typing, hundreds of millioin of users, you can still give it a try.
---
title: "512 Project-Equity Risk Dashboard"
author: Jindong Zhao
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
source_code: embed
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyquant)
library(dplyr)
library(ggplot2)
library(ggthemes)
library(Quandl)
library(quantmod) # Include TTR, where ROC fuc can be used.
library(PerformanceAnalytics) # used for chart.Regression for Beta
library(gridExtra) # use grid.arrange() function to put multiple plots on one page
library(cowplot)
```
# Introduction
Hi Prof. Hitch,
Since I am doing quantitative finance and Market/Credit Risk management, so I make this project more realtive to my working experience, close to capital market. I aso remembered you mentioned that we can choose to make project related to work, also kind of good way to demonstrate this analytic skill-set related to job content.
Actaully start from Lab1, I am trying to build up this project-Equity Risk Dashboard from following three perspective:
Performance: Cumulative returns is an good measure to evaluate whether certain Stock/Equity worth holding, buying or selling.
Sensitivity: Beta is used in the Capital Asset Pricing model (CAPM), which calculates the expected return of an asset using beta and expected market returns. We also call Beta is the sensitivity to benchmark performance.
Drawdowns: A drawdown is a peak-to-trough decline during a specific period for an investment, trading account, or fund. A drawdown is usually quoted as the percentage between the peak and the subsequent trough. If a trading account has $10,000 in it, and the funds drop to $9,000 before moving back above $10,000, then the trading account witnessed a 10% drawdown.
Following four Equity/Stock were in my portfolio:
EDU: From 2009-01-02 to 2019-11-02
BABA: From 2014-09-19 to 2019-11-02
IQ: From 2018-03-29 to 2019-11-02
SOGO: From 2017-10-26 to 2019-11-02
# Performance {.storyboard}
### Cumulative performance against Benchmark Index
```{r, fig.width=10, fig.height=6}
# Create a function cumu_return to handle dataframe pull from tidyquant
# This function is created to calculate log return and Cumulative return from daily close price
cumu_return <- function(df) {
# Since return of financial data subjective to log normal distribution
# So in practice we need to create log return=ln(St/St-1), since daily price series, so lag=1
# omit NA first if there is
df <- na.omit(df)
# add 0 as the first element
logret <- c(0, diff(log(df$close), lag = 1))
# add new Column logreturn into data frame
df <- data.frame(df, logreturn = logret)
# add new Column cumulative_return into data frame
# It is equal to cumulative product of gross return (logreturn + 1)
df <- data.frame(df, cumulative_return = cumprod(df$logreturn + 1))
}
EDU <- tq_get("EDU", get = "stock.prices", from = "2009-01-02", to = "2019-11-02")
EDU <- cumu_return(EDU)
# Prepare for S&P 500 index data
SP_EDU <- tq_get("^GSPC", get = "stock.prices", from = "2009-01-02", to = "2019-11-02")
SP_EDU <- cumu_return(SP_EDU)
# Build dataframe with Dates and price/cumulative return for both EDU and S&P 500
EDU_df <- data.frame(Date = EDU$date,
EDU_Price = EDU$close,
EDU_Cumulative_Ret = EDU$cumulative_return,
SP_Price = SP_EDU$close,
SP_Cumulative_Ret = SP_EDU$cumulative_return)
# Plot cumulative returns for both EDU and S&P 500 on the same plot, then assign to g_EDU
g_EDU <- EDU_df %>%
ggplot(aes(x = Date)) +
geom_line(aes(y = EDU_Cumulative_Ret, colour = "EDU")) +
geom_line(aes(y = SP_Cumulative_Ret, colour = "S&P 500")) +
labs(title = "Cumulative Returns: EDU vs S&P 500",
x = "Dates",
y = "Cumulative Returns") +
scale_colour_manual(name = "Equity/Benchmark Index", values = c("EDU" = "blue", "S&P 500" = "red")) +
theme_economist()
########################################################################################
# 2nd Stock/Equity: BABA
BABA <- tq_get("BABA", get = "stock.prices", from = "2014-09-19", to = "2019-11-02")
BABA <- cumu_return(BABA)
# Prepare for S&P 500 index data for BABA
SP_BABA <- tq_get("^GSPC", get = "stock.prices", from = "2014-09-19", to = "2019-11-02")
SP_BABA <- cumu_return(SP_BABA)
# Build dataframe with Dates and price/cumulative return for both BABA and S&P 500
BABA_df <- data.frame(Date = BABA$date,
BABA_Price = BABA$close,
BABA_Cumulative_Ret = BABA$cumulative_return,
SP_Price = SP_BABA$close,
SP_Cumulative_Ret = SP_BABA$cumulative_return)
# Plot cumulative returns for both BABA and S&P 500 on the same plot, then assign to g_BABA
g_BABA <- BABA_df %>%
ggplot(aes(x = Date)) +
geom_line(aes(y = BABA_Cumulative_Ret, colour = "BABA")) +
geom_line(aes(y = SP_Cumulative_Ret, colour = "S&P 500")) +
labs(title = "Cumulative Returns: BABA vs S&P 500",
x = "Dates",
y = "Cumulative Returns") +
scale_colour_manual(name = "Equity/Benchmark Index", values = c("BABA" = "blue", "S&P 500" = "red")) +
theme_economist()
########################################################################################
# 3rd Stock/Equity: IQ
IQ <- tq_get("IQ", get = "stock.prices", from = "2018-03-29", to = "2019-11-02")
IQ <- cumu_return(IQ)
# Prepare for S&P 500 index data for IQ
SP_IQ <- tq_get("^GSPC", get = "stock.prices", from = "2018-03-29", to = "2019-11-02")
SP_IQ <- cumu_return(SP_IQ)
# Build dataframe with Dates and price/cumulative return for both IQ and S&P 500
IQ_df <- data.frame(Date = IQ$date,
IQ_Price = IQ$close,
IQ_Cumulative_Ret = IQ$cumulative_return,
SP_Price = SP_IQ$close,
SP_Cumulative_Ret = SP_IQ$cumulative_return)
# Plot cumulative returns for both IQ and S&P 500 on the same plot, then assign to g_IQ
g_IQ <- IQ_df %>%
ggplot(aes(x = Date)) +
geom_line(aes(y = IQ_Cumulative_Ret, colour = "IQ")) +
geom_line(aes(y = SP_Cumulative_Ret, colour = "S&P 500")) +
labs(title = "Cumulative Returns: IQ vs S&P 500",
x = "Dates",
y = "Cumulative Returns") +
scale_colour_manual(name = "Equity/Benchmark Index", values = c("IQ" = "blue", "S&P 500" = "red")) +
theme_economist()
########################################################################################
# 4th Stock/Equity: SOGO
SOGO <- tq_get("SOGO", get = "stock.prices", from = "2017-10-26", to = "2019-11-02")
SOGO <- cumu_return(SOGO)
# Prepare for S&P 500 index data for SOGO
SP_SOGO <- tq_get("^GSPC", get = "stock.prices", from = "2017-10-26", to = "2019-11-02")
SP_SOGO <- cumu_return(SP_SOGO)
# Since SOGO price series have 9 NA, so use left_join instead
SOGO_df <- left_join(SOGO, SP_SOGO, by = "date")
# Plot cumulative returns for both SOGO and S&P 500 on the same plot, then assign to g_SOGO
g_SOGO <- SOGO_df %>%
ggplot(aes(x = date)) +
geom_line(aes(y = cumulative_return.x, colour = "SOGO")) +
geom_line(aes(y = cumulative_return.y, colour = "S&P 500")) +
labs(title = "Cumulative Returns: SOGO vs S&P 500",
x = "Dates",
y = "Cumulative Returns") +
scale_colour_manual(name = "Equity/Benchmark Index", values = c("SOGO" = "blue", "S&P 500" = "red")) +
theme_economist()
# use the grid.arrange() function from gridExtra to assemble multiple plots on one page
grid.arrange(g_EDU, g_BABA, g_IQ, g_SOGO, nrow = 2)
```
***
Conclusion:
- Here are four Equity I've invested since Jan 2015: EDU (The best eduation & training instituion in China), BABA(No need to introduce more, everyone knows Alibaba and Jack Ma), IQ (The best online video stream in China) and SOGO (the most famous on SOGO Pinyin typing). The reason I am investing into because I use literally their products everyday, so holding promising on their future. Cumulative returns is an good measure to evaluate whether certain stock worth holding, buying or selling. S&P 500 Index is selected as Beanchmark becasue all of them are listed equity in U.S.
- We will see that EDU is not beating the S&P 500 Index in terms of cumulative return for the past decade (From 2009-01-02 to 2019-11-02).But if you could invest into right after the muddy water event for EDU, then you also can obtain pretty decent capital gain.
- For BABA, without any doubt, it beats S&P 500 Index in terms of cumulative return since IPO (2014-09-19) up to 2019-11-02.
- For IQ, if you could buy in right after IPO 2018-03-29 with large volume, then sold out within first three months, you would definitely already be millionaire.
- SOGO, I kind of regret that I never sell it around 2018-7 where it was firt time marked high. Not quite sure why investor are shorting this stock, their typing products are really good. But right now, seems like it would take a long way to back to where it was on IPO.
# Sensitivity {.storyboard}
### Beta Regression Chart against Benchmark Index S&P 500
```{r, fig.width=10, fig.height=6}
# CAPM Beta for 1st stock: EDU
# Calculate Returns for Benchmark S&P 500: Daily RoC
EDU_bench_ret <- na.omit(ROC(EDU_df$SP_Price, type = "discrete"))
# Calculate Returns for EDU: Daily RoC
EDU_ret <- na.omit(ROC(EDU_df$EDU_Price, type = "discrete"))
# Get Risk Free rate, here we pull Treasury Yield 10 years, symbol is ^TNX
rf_data <- tq_get("^TNX",from = "2009-01-02", to = "2019-11-02")
# Calculate mean of Risk free rate
rf1 <- mean(rf_data$close, na.rm = TRUE)
# CAPM Beta for 2nd stock: BABA
# Calculate Returns for Benchmark S&P 500: Daily RoC
BABA_bench_ret <- na.omit(ROC(BABA_df$SP_Price, type = "discrete"))
# Calculate Returns for BABA: Daily RoC
BABA_ret <- na.omit(ROC(BABA_df$BABA_Price, type = "discrete"))
# Get Risk Free rate, here we pull Treasury Yield 10 years, symbol is ^TNX
rf_data <- tq_get("^TNX",from = "2014-09-19", to = "2019-11-02")
# Calculate mean of Risk free rate
rf2 <- mean(rf_data$close, na.rm = TRUE)
# CAPM Beta for 3rd stock: IQ
# Calculate Returns for Benchmark S&P 500: Daily RoC
IQ_bench_ret <- na.omit(ROC(IQ_df$SP_Price, type = "discrete"))
# Calculate Returns for IQ: Daily RoC
IQ_ret <- na.omit(ROC(IQ_df$IQ_Price, type = "discrete"))
# Get Risk Free rate, here we pull Treasury Yield 10 years, symbol is ^TNX
rf_data <- tq_get("^TNX",from = "2018-03-29", to = "2019-11-02")
# Calculate mean of Risk free rate
rf3 <- mean(rf_data$close, na.rm = TRUE)
# CAPM Beta for 4th stock: SOGO
# Calculate Returns for Benchmark S&P 500: Daily RoC
SOGO_bench_ret <- na.omit(ROC(SOGO_df$close.y, type = "discrete"))
# Calculate Returns for SOGO: Daily RoC
SOGO_ret <- na.omit(ROC(SOGO_df$close.x, type = "discrete"))
# Get Risk Free rate, here we pull Treasury Yield 10 years, symbol is ^TNX
rf_data <- tq_get("^TNX",from = "2017-10-26", to = "2019-11-02")
# Calculate mean of Risk free rate
rf4 <- mean(rf_data$close, na.rm = TRUE)
# Arrange four Beta Regression Chart into one plot
par(mfrow=c(2,2))
chart.Regression(EDU_ret, EDU_bench_ret, Rf = rf1,
excess.returns = FALSE, fit = c("loess", "linear"),
element.color = "blue", main = "EDU to S&P 500")
chart.Regression(BABA_ret, BABA_bench_ret, Rf = rf2,
excess.returns = FALSE, fit = c("loess", "linear"),
element.color = "blue", main = "BABA to S&P 500")
chart.Regression(IQ_ret, IQ_bench_ret, Rf = rf3,
excess.returns = FALSE, fit = c("loess", "linear"),
element.color = "blue", main = "IQ to S&P 500")
chart.Regression(SOGO_ret, SOGO_bench_ret, Rf = rf4,
excess.returns = FALSE, fit = c("loess", "linear"),
element.color = "blue", main = "SOGO to S&P 500")
```
***
Conclusion:
- Beta is used in the Capital Asset Pricing model (CAPM), which calculates the expected return of an asset using beta and expected market returns.
- We also call Beta is the sensitivity to benchmark performance, from regressoin chart we can see that EDU is not that sensitive (Normal beta range from -2 to 2 in the long term run, but for some lately IPO stock, we will see crazy high beta)
- Beta for BABA and IQ are much higher, which also confirm with their performance on the first tab. IQ has the highest beta among these four stocks.
- I am kind of surprised that beta for SOGO to S&P 500 can be a postive value, hopefully I didn't plot regression chart wrong given its poor cumulative performance.
# Drawdowns {.storyboard}
### Top 5 Drawdowns
```{r Drawdowns, fig.width=10, fig.height=6}
ticker = 'EDU'
# pull daily price Data
stock <- getSymbols.yahoo(ticker, from="2009-01-02",
to="2019-11-02", auto.assign=FALSE)[,4]
#Remove Dates With No Prices
stock <- stock[apply(stock,1,function(x) all(!is.na(x))),]
#Rename Columns
colnames(stock) <- ticker
#Calculate Return
stock_ret <- dailyReturn(stock, type='arithmetic')
#Find largest drawdowns
t <- table.Drawdowns(stock_ret)
#Seperate into vecotrs
s <- c(t[2,1], t[3,1], t[4,1], t[5,1])
e <- c(t[2,2], t[3,2], t[4,2], t[5,2])
#Make max drawdown separate
max_s <-t[1,1]
max_e <- t[1,2]
#Plot rectangles on price chart
rect <- data.frame(xmin=s, xmax=e, ymin=-Inf, ymax=Inf)
max_rect <- data.frame(xmin=max_s, xmax=max_e, ymin=-Inf, ymax=Inf)
#Plot Price Chart With Drawdowns
p <- ggplot(stock, aes(x=index(stock), y=stock$EDU)) +
geom_line(color="red") +
theme_gray()
#Overlay rectangles representing corresponding date ranges
p + geom_rect(data=rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color="yellow",fill = "blue", alpha=.1, inherit.aes = FALSE) +
geom_rect(data=max_rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color = "black", fill = "red", alpha=0.1, inherit.aes = FALSE) +
ylab("Price ($USD)") +
ggtitle(paste(names(stock),"Drawdown Periods")) +
theme(plot.title = element_text(hjust = 0.5),axis.title.x=element_blank())
########################################################################################
# 2nd Stock/Equity: BABA
ticker = 'BABA'
# pull daily price Data
stock <- getSymbols.yahoo(ticker, from="2014-09-19",
to="2019-11-02", auto.assign=FALSE)[,4]
#Remove Dates With No Prices
stock <- stock[apply(stock,1,function(x) all(!is.na(x))),]
#Rename Columns
colnames(stock) <- ticker
#Calculate Return
stock_ret <- dailyReturn(stock, type='arithmetic')
#Find largest drawdowns
t <- table.Drawdowns(stock_ret)
#Seperate into vecotrs
s <- c(t[2,1], t[3,1], t[4,1], t[5,1])
e <- c(t[2,2], t[3,2], t[4,2], t[5,2])
#Make max drawdown separate
max_s <-t[1,1]
max_e <- t[1,2]
#Plot rectangles on price chart
rect <- data.frame(xmin=s, xmax=e, ymin=-Inf, ymax=Inf)
max_rect <- data.frame(xmin=max_s, xmax=max_e, ymin=-Inf, ymax=Inf)
#Plot Price Chart With Drawdowns
p <- ggplot(stock, aes(x=index(stock), y=stock$BABA)) +
geom_line(color="red") +
theme_gray()
#Overlay rectangles representing corresponding date ranges
p + geom_rect(data=rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color="yellow",fill = "blue", alpha=.1, inherit.aes = FALSE) +
geom_rect(data=max_rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color = "black", fill = "red", alpha=0.1, inherit.aes = FALSE) +
ylab("Price ($USD)") +
ggtitle(paste(names(stock),"Drawdown Periods")) +
theme(plot.title = element_text(hjust = 0.5),axis.title.x=element_blank())
########################################################################################
# 3rd Stock/Equity: IQ
ticker = 'IQ'
# pull daily price Data
stock <- getSymbols.yahoo(ticker, from="2018-03-29",
to="2019-11-02", auto.assign=FALSE)[,4]
#Remove Dates With No Prices
stock <- stock[apply(stock,1,function(x) all(!is.na(x))),]
#Rename Columns
colnames(stock) <- ticker
#Calculate Return
stock_ret <- dailyReturn(stock, type='arithmetic')
#Find largest drawdowns
t <- table.Drawdowns(stock_ret)
#Seperate into vecotrs
s <- c(t[2,1], t[3,1], t[4,1], t[5,1])
e <- c(t[2,2], t[3,2], t[4,2], t[5,2])
#Make max drawdown separate
max_s <-t[1,1]
max_e <- t[1,2]
#Plot rectangles on price chart
rect <- data.frame(xmin=s, xmax=e, ymin=-Inf, ymax=Inf)
max_rect <- data.frame(xmin=max_s, xmax=max_e, ymin=-Inf, ymax=Inf)
#Plot Price Chart With Drawdowns
p <- ggplot(stock, aes(x=index(stock), y=stock$IQ)) +
geom_line(color="red") +
theme_gray()
#Overlay rectangles representing corresponding date ranges
p + geom_rect(data=rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color="yellow",fill = "blue", alpha=.1, inherit.aes = FALSE) +
geom_rect(data=max_rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color = "black", fill = "red", alpha=0.1, inherit.aes = FALSE) +
ylab("Price ($USD)") +
ggtitle(paste(names(stock),"Drawdown Periods")) +
theme(plot.title = element_text(hjust = 0.5),axis.title.x=element_blank())
########################################################################################
# 4th Stock/Equity: SOGO
ticker = 'SOGO'
# pull daily price Data
stock <- getSymbols.yahoo(ticker, from="2017-10-26",
to="2019-11-02", auto.assign=FALSE)[,4]
#Remove Dates With No Prices
stock <- stock[apply(stock,1,function(x) all(!is.na(x))),]
#Rename Columns
colnames(stock) <- ticker
#Calculate Return
stock_ret <- dailyReturn(stock, type='arithmetic')
#Find largest drawdowns
t <- table.Drawdowns(stock_ret)
#Seperate into vecotrs
s <- c(t[2,1], t[3,1], t[4,1], t[5,1])
e <- c(t[2,2], t[3,2], t[4,2], t[5,2])
#Make max drawdown separate
max_s <-t[1,1]
max_e <- t[1,2]
#Plot rectangles on price chart
rect <- data.frame(xmin=s, xmax=e, ymin=-Inf, ymax=Inf)
max_rect <- data.frame(xmin=max_s, xmax=max_e, ymin=-Inf, ymax=Inf)
#Plot Price Chart With Drawdowns
p <- ggplot(stock, aes(x=index(stock), y=stock$SOGO)) +
geom_line(color="red") +
theme_gray()
#Overlay rectangles representing corresponding date ranges
p + geom_rect(data=rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color="yellow",fill = "blue", alpha=.1, inherit.aes = FALSE) +
geom_rect(data=max_rect, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax),
color = "black", fill = "red", alpha=0.1, inherit.aes = FALSE) +
ylab("Price ($USD)") +
ggtitle(paste(names(stock),"Drawdown Periods")) +
theme(plot.title = element_text(hjust = 0.5),axis.title.x=element_blank())
```
***
Conclusion:
- A drawdown is a peak-to-trough decline during a specific period for an investment, trading account, or fund. A drawdown is usually quoted as the percentage between the peak and the subsequent trough. If a trading account has $10,000 in it, and the funds drop to $9,000 before moving back above $10,000, then the trading account witnessed a 10% drawdown.
- A stock’s total volatility is measured by its standard deviation, yet many investors, especially retirees who are withdrawing funds from pensions and retirement accounts, are mostly concerned about drawdowns. Volatile markets and large drawdowns can be problematic for retirees. Many look at the drawdown of their investments, from stocks to mutual funds, and consider their maximum drawdown (MDD) so they can potentially avoid those investments with the biggest historical drawdowns.
- Obviously, EDU is the best investment in the long term I have been investing ever in terms of the only one short period max drawdown
- BABA has three kind of big drawdown period, but if you are holding in long term it is stil a good investment
- IQ, again if you can invest from it just IPO and sell them out before the max drawdown, you are the winner of lie. You are probably earning some quick money in that short period before June 2018.
- SOGO, my worst investment ever in terms of drawdown period. I could have ever got a chance to sell it when just recover around June 2018, but I did not. Since then it is in deep drawdown, I never hold the hope that SOSO can recover... BUt still very good SOGO Typing, hundreds of millioin of users, you can still give it a try.