Skip to content

Commit

Permalink
added returns to prices
Browse files Browse the repository at this point in the history
  • Loading branch information
msperlin committed Jun 20, 2024
1 parent b825053 commit c7d8b34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/prices.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ get_prices <- function(ticker = "AAPL",
ticker = ticker,
exchange = exchange
) |>
dplyr::mutate(date = as.Date(date))
dplyr::mutate(date = as.Date(date),
ret_adj_close = adjusted_close/dplyr::lag(adjusted_close) - 1)

write_cache(df_prices, f_out)

Expand Down

0 comments on commit c7d8b34

Please sign in to comment.