add_adj_price: Add adjusted prices to dividens to an xts object

View source: R/utils.R

add_adj_priceR Documentation

Add adjusted prices to dividens to an xts object

Description

Add adjusted prices to dividens to an xts object

Usage

add_adj_price(x, symbol, start_date, end_date)

Arguments

x

xts object (data frames will be converted to xts)

symbol

the symbol of the company

start_date

The start date of the query. Date is a string that needs to be in yyyy-mm-dd format

end_date

The end date of the query. Date is a string that needs to be in yyyy-mm-dd format

Value

xts object with adjusted prices

Examples

start_d <- "2022-01-01"
end_d <- "2023-01-01"
symbol <- 2222
get_company_records(start_date = start_d, end_date = end_d, company_symbol = symbol) |>
df_to_xts() |>
add_adj_price(symbol = symbol, start_date = start_d, end_date = end_d)


Hussain-Alsalman/tasi documentation built on Sept. 7, 2024, 1:17 p.m.