start <- as.Date("04/01/2021",format="%m/%d/%Y")
getSymbols("USDT-BTC",src="yahoo",
           from = start, 
           to = Sys.Date())
## 'getSymbols' currently uses auto.assign=TRUE by default, but will
## use auto.assign=FALSE in 0.5-0. You will still be able to use
## 'loadSymbols' to automatically load data. getOption("getSymbols.env")
## and getOption("getSymbols.auto.assign") will still be checked for
## alternate defaults.
## 
## This message is shown once per session and may be disabled by setting 
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
## [1] "USDT-BTC"
Tether <-`USDT-BTC`
colnames(Tether)<- c("Open","High","Low","Close","Volume","Adjusted")
Tether<-na.locf(Tether,fromLast = TRUE)
Tether$Open  <- 1/Tether$Open 
Tether$High  <- 1/Tether$High
Tether$Low   <- 1/Tether$Low
Tether$Close <- 1/Tether$Close
plot(Tether$Close)

chartSeries(Tether)
addEMA(n = 5,col ="red")
addEMA(n = 25,col ="blue")
addEMA(n = 99,col ="white")
addRSI()
addMomentum()

summary(Tether$Close)
##      Index                Close      
##  Min.   :2021-04-01   Min.   :29412  
##  1st Qu.:2021-05-20   1st Qu.:37037  
##  Median :2021-07-09   Median :45455  
##  Mean   :2021-07-09   Mean   :45084  
##  3rd Qu.:2021-08-27   3rd Qu.:52632  
##  Max.   :2021-10-16   Max.   :62500
sd(Tether$Close)
## [1] 9085.978
Tether.dataframe <-data.frame(Date =index(Tether),
  Open =Tether$Open,
                              Close =Tether$Close,
                              High =Tether$High,
                              Low =Tether$Low)

ggplot(Tether.dataframe) +
  aes(x = Close) +
  geom_histogram(bins = 30L, fill = "#112446") +
  theme_minimal()

mean(Tether$Close)+2*sd(Tether$Close)
## [1] 63255.97
knitr::include_url("http://www.youtube.com/embed/9bZkp7q19f0?rel=0")