Monday, March 25, 2019

quantmod_0.4-14 on CRAN

I just pushed a new release of quantmod to CRAN! I'm most excited about the update to getSymbols() so it doesn't throw an error and stop processing if there's a problem with one ticker symbol. Now getSymbols() will import all the data it can, and provide an informative error message for any ticker symbols it could not import.

Another cool feature is that getQuote() can now import quotes from Tiingo. But don't thank me; thank Ethan Smith for the feature request [#247] and pull request [#250].

There are also several bug fixes in this release.  The most noticeable are fixes to getDividends()  and getSplits()Yahoo! Finance continues to have stability issues. Now it returns raw dividends instead of split-adjusted dividends (thanks to Douglas Barnard for the report [#253]), and the actual split adjustment ratio instead of the inverse (e.g. now 1/2 instead of 2/1).  I suggest using a different data provider. See my post: Yahoo! Finance Alternatives for some suggestions.

See the news file for the other bug fixes. Please let me know what you think about these changes.  I need your feedback and input to make quantmod even better!

Tuesday, November 6, 2018

xts 0.11-2 on CRAN

xts version 0.11-2 was published to CRAN yesterday. xts provides data structure and functions to work with time-indexed data.  This is a bug-fix release, with notable changes below:
  • The xts method for shift.time() is now registered. Thanks to Philippe Verspeelt for the report and PR (#268, #273).
  • An if-statement in the xts constructor will no longer try to use a logical vector with length > 1. Code like if (c(TRUE, TRUE)) will throw a warning in an upcoming R release, and this patch will prevent that warning. Thanks to Hugh Parsonage for the report and PR (#270, #272).
  • Fix subset when index(i) and i contain duplicates. Observations were being incorrectly dropped, and behavior is now consistent with zoo. Thanks to Stack Overflow user scs for the report, and Philippe Verspeelt for the help debugging (#275).
  • Make column names for merge() results with unnamed objects shorter and more like zoo (#248). Previously, column names could be hundreds, even thousands, of characters. This change has the added benefit of making na.fill() much faster (#259). NOTE: This may BREAK existing code for integer unnamed objects.
  • The to.period() family of functions now use the index timezone when converting intraday index values to daily values (or lower frequency). Previously, the dates would be calculated as UTC dates, instead of dates in the local timezone (as they are now). Thanks to Garrett See and Gabor Grothendieck for the reports (#53, #277).
As always, I'm looking forward to your questions and feedback! If you have a question, please ask on Stack Overflow and use the [r] and [xts] 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, but please read the contributing guide first!

Wednesday, September 12, 2018

xts 0.11-1 on CRAN

xts version 0.11-1 was published to CRAN this morning. xts provides data structure and functions to work with time-indexed data.  This release contains some awesome features that will transparently make your xts code even faster!
  • There's a new window.xts() method, thanks to Corwin Joy (#100, #240). Corwin also refactored and improved the performance of the binary search algorithm used to subset xts objects. Tom Andrews reported and fixed a few related regressions (#251, #263, #264).
  • The na.locf.xts() method loops over columns of multivariate objects in C code, for improved speed and memory performance. Thanks to Chris Katsulis and Tom Andrews for their reports and patches (#232, #233, #234, #235, #237).
  • After many years, merge.xts() can finally handle multiple character or complex xts objects. Thanks to Ken Williams for the report (#44).
  • You can use "quarters" to specify tick/grid mark locations on plots. Thanks to Marc Weibel for the report (#256).
There are also a few notable bug fixes:
  • make.index.unique() always returns a unique and sorted index. Thanks to Chris Katsulis for the report and example (#241).
  • Plots have better axis tick mark locations, thanks to Dirk Eddelbuettel (#246).
  • periodicity() now warns instead of errors if the xts object contains less than 2 observations (#230).
  • first() and last() now keep dims when they would otherwise be dropped by a regular row subset. This is consistent with head() and tail(). Thanks to Davis Vaughan for the report (#226).
  • An invalid ISO8601 range subset now returns no data instead of all rows (#96).
As always, I'm looking forward to your questions and feedback! If you have a question, please ask on Stack Overflow and use the [r] and [xts] 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, but please read the contributing guide first!

Friday, August 24, 2018

Learning to code is worth it

Someone recently shared this great talk by Chris Allen from lambda conf 2017.  The title of the talk is "Why Johnny Can't Code Good," but the content is more about how to grow as a programmer.  His points are true whether you're just starting out, or have been coding for years.



My notes from Chris' talk are below, in the order they appear in the presentation.  My thoughts are in parentheses.



He's not talking about people who can't code, but rather those who haven't learned to code.  They usually work in the industry, but only know just enough to get things done.  They aren't super-independent, and may have trouble taking on new things.  All of us have been here before (often multiple times in different disciplines; whenever we start something new).

The problem is when you get stuck working on pre-defined tasks in a well-defined space.  The computer science industry's priorities are now wrapped around accommodating people who are comfortable staying there.

For example, nodejs, Go, and other new languages optimize for "zero-to-blog", not for something maintainable, or that allows people to build useful abstractions.  There's more focus on what is marketable in a short blog post.

(An interesting point on hiring:) you can't "hire only the best", unless you're able to attract talent. You can't select for it, because other employers trying to "hire only the best" too.

Using new tools is not learning new skills.  Learning how to learn, without someone feeding you pre-digested material, is how you grow.

Don't say something is easy. It's always going to be harder for some, it depends on their context. Either something is worth learning, or it's not. There may be some return-on-investment cutoff point, but it's either worth trying or it's not.

We're an amnesiac culture. We don't remember 5 years ago (and we don't like learning history).

Don't train how you play. Train harder, be more focused and structured.  (This is a sports analogy. The idea is that you work harder in training than you will work during a game.  That makes the game seem easy.  I have a habit of doing harder things when I'm doing something of lesser consequence.  People often asked me how I learned something, and the answer is often "I broke something and learned until I understood what I broke and what was needed to fix it."  This is sub-optimal at work, when a faster solution that isn't fully understood is preferable to a slower solution that is.)

Friday, April 20, 2018

R/Finance 2018 Registration

This year marks the 10th anniversary of the R/Finance Conference!  As in prior years, we expect more than 250 attendees from around the world. R users from industry, academia, and government will joining 50+ presenters covering all areas of finance with R.  The conference will take place on June 1st and 2nd, at UIC in Chicago.

You can find registration information on the conference website, or you can go directly to the Cvent registration page.

Note that registration fees will increase by 50% at the end of early registration on May 21, 2018.

We are very excited about keynote presentations by JJ AllaireLi Deng, and Norm Matloff.  The conference agenda (currently) includes 18 full presentations and 33 shorter "lightning talks".  As in previous years, several (optional) pre-conference seminars are offered on Friday morning.  We're still working on the agenda, but we have another great lineup of speakers this year!

There is also an (optional) conference dinner at Wyndham Grand Chicago Riverfront in the 39th Floor Penthouse Ballroom and Terrace.  Situated directly on the riverfront, it is a perfect venue to continue conversations while dining and drinking.

We would to thank our 2018 Sponsors for the continued support enabling us to host such an exciting conference:

  UIC Liautaud Master of Science in Finance
  Microsoft
  R Consortium
  RStudio
  William Blair
  Citadel
  Quasardb

On behalf of the committee and sponsors, we look forward to seeing you in Chicago!

  Gib Bassett, Peter Carl, Dirk Eddelbuettel, Brian Peterson, Dale Rosenthal, Jeffrey Ryan, Joshua Ulrich

Friday, April 13, 2018

Goodbye Google, Hello Tiingo!

First, the bad news:

Google Finance no longer provides data for historical prices or financial statements, so we say goodbye to getSymbols.google() and getFinancials.google(). (#221)  They are now defunct as of quantmod 0.4-13.

Now, the good news:

Thanks to Steve Bronder, getSymbols() can now import data from Tiingo! (#220)  This feature is part of quantmod 0.4-13, which is now on CRAN.  Windows and Mac binaries should be built in a day or two.

Tiingo is a web service that provides tools and data for financial analysis.  They provide daily price history for US stocks and ADRs, Chinese stocks, Mutual Funds, and ETFs.  There is up to 30+ years of history, including raw prices and split/dividend adjusted prices.

All this data is accessible for free, with reasonable symbol and bandwidth limits.  All you need to get started is a one-time registration for an API token.  You should see your API token just above the beginning of the metadata section, after logging in, of course.  Tiingo has a well-documented daily price data API that returns either JSON or CSV.

To get started, install the latest quantmod from CRAN.  Then you call:

  getSymbols("MSFT", src = "tiingo", api.key = "[your key]") 

Where you replace "[your key]" with the API key you receive after registration.  You can use setDefaults() to set your API key one time, and use it for all getSymbols.tiingo() calls.

  setDefaults("getSymbols.tiingo", api.key = "[your key]")

Other notable changes:
  • There is now a getQuote.alphavantage() that allows you to pull real-time quotes from Alpha Vantage.  Thanks to Ethan Smith! (#213, #223)
  • Speaking of Alpha Vantage, getSymbols.av() can now pull weekly and monthly adjusted prices. (#212)
  • The URL in getSymbols.oanda() and getFX() has been updated, so they work again. (#225)
  • getQuote.yahoo() no longer errors when a field has no data for all requested tickers. (#208)
  • saveChart() actually saves charts now (#154). Brilliant!


Monday, March 19, 2018

xts 0.10-2 on CRAN

This xts release contains mostly bugfixes, but there are a few noteworthy features. Some of these features were added in version 0.10-1, but I forgot to blog about it. Anyway, in no particular order:

  • endpoints() gained sub-second accuracy on Windows (#202)!
  • na.locf.xts() now honors 'x' and 'xout' arguments by dispatching to the next method (#215). Thanks to Morten Grum for the report.
  • na.locf.xts() and na.omit.xts() now support character xts objects. Thanks to Ken Williams and Samo Pahor for the reports (#42).

Many of the bug fixes were related to the new plot.xts() introduced in 0.10-0. And a handful of bugfixes were to make xts more consistent with zoo in some edge cases.

As always, I'm looking forward to your questions and feedback!  If you have a question, please ask on Stack Overflow and use the [r] and [xts] 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, but please read the contributing guide first!