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
  R Consortium
  William Blair

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!

Tuesday, January 9, 2018

R/Finance 2018: Call for Papers

R/Finance 2018: Applied Finance with R
June 1 and 2, 2018
University of Illinois at Chicago

Call For Papers

The tenth annual R/Finance conference for applied finance using R will be held June 1 and 2, 2018 in Chicago, IL, USA at the University of Illinois at Chicago. The conference will cover topics including portfolio management, time series analysis, advanced risk tools, high-performance computing, market microstructure, and econometrics. All will be discussed within the context of using R as a primary tool for financial risk management, portfolio construction, and trading.

Over the past nine years, R/Finance has included attendees from around the world. It has featured presentations from prominent academics and practitioners, and we anticipate another exciting line-up for 2018.

We invite you to submit complete papers in pdf format for consideration. We will also consider one-page abstracts (in txt or pdf format) although more complete papers are preferred. We welcome submissions for both full talks and abbreviated lightning talks. Both academic and practitioner proposals related to R are encouraged.

All slides will be made publicly available at conference time. Presenters are strongly encouraged to provide working R code to accompany the slides. Data sets should also be made public for the purposes of reproducibility (though we realize this may be limited due to contracts with data vendors). Preference may be given to presenters who have released R packages.

Please submit proposals online at http://go.uic.edu/rfinsubmit. Submissions will be reviewed and accepted on a rolling basis with a final submission deadline of February 2, 2018. Submitters will be notified via email by March 2, 2018 of acceptance, presentation length, and financial assistance (if requested).

Financial assistance for travel and accommodation may be available to presenters. Requests for financial assistance do not affect acceptance decisions. Requests should be made at the time of submission. Requests made after submission are much less likely to be fulfilled. Assistance will be granted at the discretion of the conference committee.

Additional details will be announced via the conference website as they become available. Information on previous years' presenters and their presentations are also at the conference website. We will make a separate announcement when registration opens.

For the program committee:
Gib Bassett, Peter Carl, Dirk Eddelbuettel, Brian Peterson, 
Dale Rosenthal, Jeffrey Ryan, Joshua Ulrich

Friday, January 5, 2018

RQuantLib 0.4.4 for Windows

I'm pleased to announce that the RQuantLib Windows binaries are now up to 0.4.4!  The RQuantLib pre-built Windows binaries have been frozen on CRAN since 0.4.2, but now you can get version 0.4.4 binaries on Dirk's ghrr drat repo.

Installation is as simple as:

drat::addRepo("ghrr") # maybe use 'install.packages("drat")' first 
install.packages("RQuantLib", type="binary")

I will be able to create Windows binaries for future RQuantLib versions too, now that I have a Windows QuantLib build (version 1.11) to link against.

Dirk and I plan to talk with CRAN about getting the new binaries hosted there.  Regardless, they will always be available via the drat repo.