Description Usage Arguments Value Examples
Adjusted closing prices
1 | adjusted_ohlc(values, factors, adjust = c("qfq", "hfq"))
|
values |
a data.table, keyed by date/time column. Can be obtained from eod market functions. |
factors |
a data.table, keyed by date/time column. Can be obtained from adj_factor(). |
adjust |
following Tushare Pro convention, qfq adjusts previous closing prices w.r.t last closing prices, hfq adjusts closing prices w.r.t first traded price. |
data.table
1 2 3 4 5 6 7 8 9 10 | ## Not run:
#query prices and adjust factors
pab <- daily(ts_code = "000001.sz")
pab_af <- adj_factor(ts_code = "000001.sz")
#post-adjusted
pab_adjusted <- adjusted_ohlc(pab, pab_af, "hfq")
#pre-adjusted
pab_adjusted <- adjusted_ohlc(pab, pab_af, "qfq")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.