md_stock_adjust adjusts the open, high, low and close stock prices for split and dividend.

md_stock_adjust(dt, source, adjust = "split", adjfactor = NULL)

Arguments

dt

a list/dataframe of time series datasets that didnt adjust for split or dividend.

source

the available data sources are 'yahoo' (http://finance.yahoo.com) and '163' (http://money.163.com).

adjust

adjust the OHLC prices for split (default), or dividend (both split and dividend). If it is NULL, return the original data. For the yahoo data, the original data already adjust for split, and use the 'close_adj' column to adjust; for the 163 data, the original doesnot adjust any factors, and use the splits, dividends and issues to adjust.

adjfactor

adjust factors, including splits and dividends. Defaults to NULL, which will load adjust factors from source. It can also download from md_stock when type set as adjfactor.

Examples

# \donttest{ dt = md_stock('600547', source = '163', date_range = 'max', type = 'history', adjust = NULL)
#> 1/1 600547
ds = md_stock('600547', source = '163', date_range = 'max', type = 'adjfactor')
#> 1/1 600547
dtadj = md_stock_adjust(dt, source = '163', adjust = 'dividend', adjfactor = ds) # }