joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
822 stars 224 forks source link

getDividends returning "Inf" from Yahoo #268

Closed tjaksabin closed 5 years ago

tjaksabin commented 5 years ago

Description

For certain symbols, getDividends does not retrieve the dividends correctly. This has been occurring for the last couple of weeks. In place of dividends, getDividends returns "Inf".

Expected behavior

getDividends works correctly for most symbols.

Minimal, reproducible example

getDividends("TRI")

Session Info

       TRI.div

2002-08-20 Inf 2002-11-19 Inf 2003-02-18 Inf 2003-05-20 Inf 2003-08-19 Inf 2003-11-18 Inf 2004-02-20 Inf 2004-05-18 Inf 2004-08-17 Inf 2004-11-16 Inf 2005-02-17 Inf 2005-05-17 Inf 2005-08-16 Inf 2005-11-15 Inf 2006-02-16 Inf 2006-05-16 Inf 2006-08-22 Inf 2006-11-20 Inf 2007-02-15 Inf 2007-05-22 Inf 2007-08-21 Inf 2007-11-19 Inf 2008-02-19 Inf 2008-04-14 Inf 2008-08-20 Inf 2008-11-18 Inf 2008-11-19 Inf 2009-03-04 Inf 2009-05-20 Inf 2009-08-19 Inf 2009-11-18 Inf 2010-03-04 Inf 2010-05-18 Inf 2010-08-17 Inf 2010-11-16 Inf 2011-02-17 Inf 2011-05-17 Inf 2011-08-16 Inf 2011-11-15 Inf 2012-02-17 Inf 2012-05-22 Inf 2012-08-21 Inf 2012-11-19 Inf 2013-02-21 Inf 2013-05-21 Inf 2013-08-20 Inf 2013-11-19 Inf 2014-02-20 Inf 2014-05-20 Inf 2014-08-19 Inf 2014-11-18 Inf 2015-02-19 Inf 2015-05-19 Inf 2015-08-18 Inf 2015-11-17 Inf 2016-02-19 Inf 2016-05-17 Inf 2016-08-16 Inf 2016-11-15 Inf 2017-02-21 Inf 2017-05-16 Inf 2017-08-15 Inf 2017-11-15 Inf 2018-02-21 Inf 2018-05-16 Inf 2018-08-15 Inf 2018-11-14 Inf 2019-03-07 0.36

joshuaulrich commented 5 years ago

getDividends() adjusts dividends for splits by default, and Yahoo Finance is returning a "1/0 Stock Split" on 2018-11-27. Call getDividends() with split.adjust = FALSE) to work around this weird data Yahoo Finance returns.

I'm closing this because it's an issue with Yahoo Finance that most likely can't be addressed by changing code in quantmod. Please let me know of any other issues you find like this, in case it's something systematic at Yahoo that we may be able to apply a heuristic for. We can re-open this issue in that case.

Also, I recommend you use another data provider, like www.tiingo.com. Yahoo Finance has had serious quality issues over the past few years.