Learn R Programming

pedquant (version 0.1.7)

md_stock_adjust: adjust stock price for split and dividend

Description

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

Usage

md_stock_adjust(dt, source = NULL, adjust = TRUE, ...)

Arguments

dt

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

source

the available data sources are 'yahoo' and '163'. The source will set to yahoo, if the dt has close_adj column; and will set to 163, if the dt has close_prev column.

adjust

whether to adjust the OHLC prices. If it is NULL or FALSE, return the original data. Default is TRUE. For the yahoo data, the adjustment is based on the close_adj; for the 163 data, the adjustment is based on the cumulative products of close/close_prev.

...

Additional parameters.

Examples

Run this code
# NOT RUN {
dt = md_stock('600547', source = '163', date_range = 'max')

dtadj = md_stock_adjust(dt, source = '163')
# }

Run the code above in your browser using DataLab