Why are Open, High, Low prices incorrect when using quantmod?

I use this code weekly, however, when I tried it today, I got the wrong OHL and SPY results. Changed by looking at closing prices and volume, they seem right, so what's wrong?

rm(list = ls()) options(scipen=999) require(quantmod) spy<-getSymbols("SPY", src = 'yahoo', from = '2007-05-31', auto.assign = T) spy<-cbind(SPY) dim(SPY) head(SPY) This the outcome from Yahoo: Date Open High Low Close Adj Close* Volume May 31, 2007 153.67 153.89 153.12 153.32 123.86 114,866,700 This is the outcome from the API( using quantmod): SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted 2007-05-31 190.217 190.489 189.536 153.32 114866700 123.8624 
+5
source share
1 answer

Confirmed that this is a problem. Yahoo provided split-adjusted prices for open, high, low, and adjusted closed prices, as well as raw closing prices. getSymbols used adjusted and closed prices to adjust Open, High and Low prices.

Now it seems that Yahoo is providing an adjusted closing, which is divided and adjusted for dividends. Open, High and Low prices are still scheduled and therefore must be unadjusted, but the Close-to-Adjusted-Close relationship can no longer be used.

+3
source

Source: https://habr.com/ru/post/1269210/


All Articles