Import stock prices

stocks <- tq_get(c("AVGO", "AMD", "CRWD"),
                 get = "stock.prices",
                 from = "2022-10-25",
                 to = "2024-03-15")
stocks
## # A tibble: 1,044 × 8
##    symbol date        open  high   low close   volume adjusted
##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>    <dbl>    <dbl>
##  1 AVGO   2022-10-25  45.8  46.4  45.7  46.0 18246000     44.3
##  2 AVGO   2022-10-26  45.8  47.2  45.5  46.1 29291000     44.4
##  3 AVGO   2022-10-27  46.6  47.1  45.5  45.5 18512000     43.8
##  4 AVGO   2022-10-28  45.7  47.4  45.6  47.3 23094000     45.5
##  5 AVGO   2022-10-31  46.7  47.3  46.5  47.0 19259000     45.2
##  6 AVGO   2022-11-01  47.6  47.7  46.3  46.8 16324000     45.0
##  7 AVGO   2022-11-02  47.0  48.0  45.6  45.6 21070000     43.9
##  8 AVGO   2022-11-03  45.1  45.3  44.1  44.4 23887000     42.7
##  9 AVGO   2022-11-04  45.7  46.9  45.3  46.5 28891000     44.8
## 10 AVGO   2022-11-07  46.7  47.8  46.2  47.5 17687000     45.7
## # ℹ 1,034 more rows

Plot stock prices

stocks %>%
    
    ggplot(aes(x = date, y = adjusted, color = symbol)) +
    geom_line()