Import data
# excel file
data <- read_excel("data/QQQ.xlsx")
data
## # A tibble: 263 × 3
## Date Close Diff20Day
## <dttm> <dbl> <dbl>
## 1 2022-04-27 00:00:00 314. -0.0553
## 2 2022-04-28 00:00:00 326. -0.0147
## 3 2022-04-29 00:00:00 311. -0.0547
## 4 2022-05-02 00:00:00 316. -0.0491
## 5 2022-05-03 00:00:00 316. -0.0457
## 6 2022-05-04 00:00:00 327. -0.0182
## 7 2022-05-05 00:00:00 311. -0.0495
## 8 2022-05-06 00:00:00 307. -0.0514
## 9 2022-05-09 00:00:00 295. -0.0772
## 10 2022-05-10 00:00:00 298. -0.0705
## # … with 253 more rows
Plot data
closeChart <- ggplot(data = data) +
geom_line(mapping = aes(x = Date, y = Close))
closeChart

diffChart <- ggplot(data = data) +
geom_line(mapping = aes(x = Date, y = Diff20Day))
diffChart
