Skip to content

Instantly share code, notes, and snippets.

@SOKHUONG
Last active December 21, 2021 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SOKHUONG/c4d8c1e1d1206eda5393bfb4aa7230dc to your computer and use it in GitHub Desktop.
Save SOKHUONG/c4d8c1e1d1206eda5393bfb4aa7230dc to your computer and use it in GitHub Desktop.

1. A short description of the company:

  • Tesla, Inc. Was founded on July 1, 2003, by Elon Musk, Martin Eberhard, JB Straubel, Marc Tarpenning, and Ian Wright.
  • It is an electric automobiles vehicle and cleans energy company.
  • Tesla designs and manufactures electric cars, battery energy storage from home to grid-scale, solar panels and solar roof tiles, and related products and services.
  • Its mission is to accelerate the world’s transition to sustainable energy.

2. Listed on which stock exchange?

  • Tesla’s stock was listed on NASDAQ with the name TSLA.

3. When did they apply for IPO?

  • They applied for IPO on Tuesday, June 29, 2010.

4. What was their stock price (IPO) while they apply for IPO?

  • The stock price was $17.00 per share when they initially applied for IPO. Stock price open at $3.8.

5. What is their current stock price?

  • Their current stock price is around $939.53 per share (December 17, 2021).

6. Are there any solutions or outcomes that this research could support?

  • Tesla, Inc. was initially named Tesla Motor, Inc.
  • Tesla was founded in 2003 and just went on to launch its first Initial Public Offering (IPO) on NASDAQ on June 29, 2010, and the price were $17.00 per share.
  • TSLA remain low for years but started to remarkably increase in 2020 despite the COVID-19 Pandemic.
  • From 2020, TSLA grow significantly to around $450 in August 2020, and in November 2021 it was around $1200.
  • There are some reasons that lead to this improvement of TSLA:
    1. Profitability: despite the COVID-19 Pandemic, Tesla still made a profit from selling about 500,000 units of electric cars in 2020 and successfully made a net profit compared to the net losses in previous years.
    2. Strong Net Worth: Tesla raised more than $12 billion from issuing new shares.
    3. Joined S&P 500: Institutional investors have to buy TSLA if they buy ETF of S&P 500.

References:

library(tidyquant)
library(ggplot2)
#define interval
week_to_show = 60
end_date = ymd("2021-12-18")
start_date = end_date - weeks(week_to_show)
#In this data, quantitative data are:
# date, pen, high, low, close, volume, adjusted
#Qualitative data is symbol
#get the data
TSLA <- tq_get(
"TSLA",
get = "stock.prices",
from = start_date,
to = end_date
)
# Create chart
ggplot(
data=TSLA,
aes(
x = date
)
) +
#REGION Candle Stick
geom_candlestick(
aes(
open = open,
close = close,
high = high,
low = low,
)
) +
#ENDREGION Candle Stick
#REGION Volume
geom_step(
aes(
#scale volume down by 500,000 times to fit the plot nicely
y = volume / 500000
),
linetype = "solid",
color = "white"
) +
#ENDREGION Volume
#REGION Technical Analysis
#Moving average
geom_ma(
aes(
y = close
),
ma_fun = EMA, #Exponential Moving Average
n = 50,
color = "yellow",
linetype = 1,
size = 1
) +
#Bollinger Bands
geom_bbands(
aes(
high = high,
low = low,
close = close
),
ma_fun = EMA,
n = 20,
sd = 2,
size = 0.5,
color_ma = "blue"
) +
#ENDREGION Technical Analysis
#REGION Style
theme_tq_green() +
labs(
title = "TSLA Price Action",
subtitle = "Tesla price action",
x = "",
y = "Price in USD"
)
#ENDREGION Style
#export data
write.csv(TSLA, file="TSLA.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment