New answers tagged

1

This seems to work for me: library(quantmod) # import data sym <- "SHANTIGEAR.BO" x <- getSymbols(sym, auto.assign = FALSE) div <- getDividends(sym) spl <- getSplits(sym) # calculate adjustment ratios ratios <- adjRatios(close = Cl(x), dividends = div, splits = spl) # apply adjustment ratios to original data adjusted <- ...


1

This has already been answered but I will try to provide more insight. The formula that you should use for forward adjusting: $$P_{adj, j}=P_{unadj, j}*\prod_{i=1}^{j} f_i$$ $$f_i=1+\frac{d_i}{P_{unadj, i}}$$ where $d_i$ is a dividend paid on day $j$ and $P_{unadj, j}$ is unadjusted price for that day. for backward adjusting we have: $$P_{adj, j}=P_{unadj,j}*...


3

The methodology has to be wrong to generate negative prices. Dividends and splits both generate proportional shifts in nominal prices, that are positive. A proportional shift to any positive number generates a positive number. The problem with the company given is that it seems to pay a >100% dividend to its previous close, which is why the previous adj ...


Top 50 recent answers are included