quantmod_0.4.22 on CRAN
An updated version of quantmod is now on CRAN. It adds functions
has.HL() to check for ‘high’ and ‘low’ price columns. It also makes accessing Yahoo Finance price, dividend, and split data more robust.
from arguments, like other
getSymbols() methods. The remaining changes are bug fixes and maintenace chores.
This was mainly a maintenance and bug fix release, but it does include a couple nice features. quantmod versions 0.4.17 through 0.4.21 included several relevant features that weren’t highlighted in any previous posts. They’re included in a separate section below.
has.HL()functions and added documentation. These were added in 0.4.20 but not exported or included in the documentation.
Switched to the Yahoo Finance v8 JSON endpoint and removed the v7 CSV endpoint. There seems to be a rate limit for the number of tickers you can request via the CSV endpoint. The yfinance python library uses the JSON endpoint and doesn’t seem to have rate limit issues. (#360, #362, #364)
fromarguments. So users can set the ‘from’ and ‘to’ arguments for FRED data like they can for other data sources like Yahoo. Those values had been ignored and the entire series was always returned. (#368)
getSplits()for stocks that issue monthly dividends. (#372)
Added error handling to
getDividends()didn’t handle cases where the download failed, or when dividends needed to be split-adjusted but there were no splits. It also tried to set colnames on the empty xts object that’s returned when there are no dividends.
getSplits()had the same colnames issue. Thanks to Chris Cheung for the report! (#366)
Remove “^” prefix from
getSymbols()return value. The name of the object
getSymbols()created and the symbol value it returned were inconsistent when the ‘Symbols’ argument has a “^” prefix and
auto.assign = TRUE:
getSymbols()removed the “^” from the object it creates, but
- returned the ‘Symbols’ argument unchanged, and
- removed the “^” from the column names of the object it creates.
The example below will create an object named
IXICbut the value of
symwill be “^IXIC”.
sym <- getSymbols("^IXIC")
x <- get(sym)will not work because an object named
^IXICdoesn’t exist. (#371)
Moved jsonlite from Suggests to Imports so it doesn’t cause a problem when a package that doesn’t also Suggest jsonlite but uses
getSymbols(). Thanks to Kurt Hornik for the report and fix! (#380)
Fixed S3 method issues. R-devel (83995-ish) added a check that found methods that were not registered (
seriesLo.timeSeries()). It was also confused by
unique.formula.names()because they are named like S3 methods. Neither were exported so they didn’t affect users. Thanks to Kurt Hornik for the report! (#375)
Changes in Prior Versions
HL()and supporting functions. These are analogues to
OHLC(), etc. Thanks for Karl Gauvin for the nudge to implement them.
Added adjusted close price to
getSymbols.tiingo()output. Thanks to Ethan Smith for the suggestion and patch! (#289, #345)
getSymbols.tiingo()to use a Date index for daily data. Thanks to Ethan Smith for the report! (#350)
getOptionChain()to return all the fields that Yahoo Finance provides. Thanks to Adam Childers (@rhizomatican) for the patch! (#318, #336)
Added orats as a source for
getOptionChain(). Thanks to Steve Bronder (@SteveBronder) for the suggestion and implementation! (#325)
Added “Defaults” handling to
getQuote.yahoo(). Thanks to Ethan Smith for the report. (#291)
Added Bid and Ask fields to the output from
getQuote(). Thanks to @jrburl for the report and PR. (#302)
Removed check for Yahoo Finance cookies because the site no longer responds with a cookie, and that caused the connection attempt to fail. This affected
getSplits(). Thanks to several users for reporting, and especially to @pverspeelt and @alihru for investigating potential fixes! (#358)
getSymbols.yahooj()for changes to the web page. (#312)
Removed unneeded arguments to the
getSymbols.tiingo()implementation. Thanks to Ethan Smith for the suggestion and patch! (#343, #344)
Load dividends and splits data into the correct environment when the user provides a value for the
envargument. The previous behavior always loaded the data into the environment the function was called from. Thanks to Stewart Wright for the report and patch! (#33)
Improved the error message when
getSymbols()cannot import data for a symbol because the symbol is not valid or does not have historical data. Thanks to Peter Carl for the report. (#333)
getMetals()example in the documentation. The example section previously had an example of
getFX(). Thanks to Gerhard Nachtmann (@nachti) for the report and patch! (#330)
getQuote()so it returns data when the ticker symbol contains an “&”. Thanks to @pankaj3009 for the report! (#324)
colis specified. Thanks to @nvalueanalytics for the report! (#321)
Fixed issues handling https:// in
getSymbols.yahooj(). Thanks to @lobo1981 and @tchevri for the reports and Ethan Smith for the suggestion to move from XML to xml2. (#310, #312)
getSplits()so they all handle download errors and retry again. Thanks for @helgasoft for the report on
getSymbols.yahoo()and @msfsalla for the report on
getSplits(). (#307, #314)
Added implied volatility and last trade date to
getOptionChain()output. Thanks to @hd2581 and @romanlelek for the reports. And thanks to @rjvelasquezm for noticing the error when
NULL. (#224, #304)
getOptionChain()to throw a warning and return
NULLfor every expiry that doesn’t have data. (#299)
Fixed “Defaults” to handle unexported function (e.g.
getQuote.av(). Thanks to @helgasoft for the report. (#316)
get()on vector with length > 1. Thanks to Kurt Hornik for the report. (#319)
chartTheme()now works when quantmod is not attached. Thanks to Kurt Hornik for the report.
If you love using my open-source work (e.g. quantmod, TTR, xts, IBrokers, microbenchmark, etc.), you can give back by sponsoring me on GitHub. I truly appreciate anything you’re willing and able to give!
I look forward to your questions and feedback! If you have a question, please ask on Stack Overflow and use the [r] and [quantmod] tags. Or you can send an email to the R-SIG-Finance mailing list (you must subscribe to post). Open an issue on GitHub if you find a bug or want to request a feature. Please read the contributing guide first! It will help save time for both of us. ;-)