Monday, April 20, 2015

plot.xts RFC

We have been working on a new charting engine for xts::plot.xts for the past couple years. It started with Michael Weylandt's work during the 2012 Google Summer of Code, and Ross Bennett took up the torch during the 2014 GSoC.

This new engine improves the functionality, modularity, and flexibility of plot.xts by building off the framework Jeff Ryan began with quantmod::chart_Series.  The modular framework allows users to plot an xts object and incrementally build custom charts by adding panels of new data (including transformations of the original xts object).

The main objective was to provide functionality similar to chartSeries and addTA for xts objects. The current code includes support for:
  • Basic time series plots with sensible defaults
  • Plotting xts objects by column "automagically" as separate panels
  • Small multiples with multiple pages
  • "Layout-safe" so multiple specifications/panels can be charted in a single device
  • Easily add data to an existing plot or add panels similar to quantmod::add*
  • Event lines
The xts team would greatly appreciate any comments, feedback, and bug reports before the upcoming CRAN release at the end of April.

The new version of plot.xts is in the main xts development code base, which is available on GitHub in the develop branch.  GitHub is also the place to submit bug reports and feature requests.

Note that the new plot.xts includes breaking changes to the original (and rather limited) plot.xts.  However, we believe the new functionality more than compensates for the potential one-time inconvenience.

Tuesday, March 31, 2015

Registration Open for R/Finance 2015!

You can find registration information and agenda details (as they become available) on the conference website.  Or you can go directly to the registration page.  Note that there's an early-bird registration deadline of May 15.

The conference will take place on May 29 and 30, at UIC in Chicago.  Building on the success of the previous conferences in 2009-2014, we expect more than 250 attendees from around the world. R users from industry, academia, and government will joining 30+ presenters covering all areas of finance with R.

We are very excited about the four keynote presentations given by Emanuel Derman, Louis Marascio, Alexander McNeil, and Rishi Narang.  The main agenda (currently) includes 18 full presentations and 19 shorter "lightning talks".  As in previous years, several (optional) pre-conference seminars are offered on Friday morning.

There is also an (optional) conference dinner that will once-again be held at The Terrace at Trump Hotel. Overlooking the Chicago river and skyline, it is a perfect venue to continue conversations while dining and drinking.

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

International Center for Futures and Derivatives at UIC

Revolution Analytics
MS-Computational Finance at University of Washington

Ketchum Trading

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

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

Tuesday, March 10, 2015

Import Japanese equity data into R with quantmod 0.4-4

I pushed quantmod 0.4-4 to CRAN this weekend.  It adds a getSymbols.yahooj function to pull stock data from Yahoo Finance Japan, and fixes issues in and getSymbols.oanda.

Changes to the Yahoo Finance and Oanda websites broke the and getSymbols.oanda functions, respectively.  I didn’t use much, so I’m not certain I restored all the prior functionality.  Let me know if there’s something I missed. I’d be glad to add a test case for that, or to add a test you’ve written.

The getSymbols.yahooj function is a major enhancement provided by Wouter Thielen.  It allows quantmod users to pull stock data from Yahoo Finance Japan.

Japanese ticker symbols usually start with a number and it is cumbersome to use variable names that start with a number in the R environment, so the string "YJ" will be prepended to each of the Symbols.  I recommend using setSymbolLookup to prepend the ticker symbols with “YJ” yourself, so you can just use the main getSymbols function.

For example, if you want to pull Sony data, you would run:

The full list of supported data sources for quantmod is now: Yahoo Finance-US, Yahoo Finance-Japan, Google Finance, csv, RData (including rds and rda), FRED, SQLite, MySQL, and Oanda.

Contributions to add support for additional data sources are welcomed.  The existing getSymbols functions are good templates to start from.

Tuesday, March 3, 2015

Google Summer of Code 2015

The R Project has once again been selected as a mentoring organization for this year's Google Summer of Code (GSoC).  If you're not familiar with GSoC, it's a global program that offers students a stipend to write code for open source projects, under the direction of a mentor.  Mentors get code written for their project, but no money.  Students get something like a paid summer internship, with open-source contributions they can reference on their resume.

If you’re interested in participating as a student or a mentor, there's an overview of the GSoC program on The R Project GSoC 2015 Wiki.  The wiki also includes a timeline and links to prior year's projects.

Several mentors from various backgrounds have already proposed projects for students to work on this summer.  Mentors have until March 9th to submit projects they would be willing to support, and student applications begin on March 16th.

Monday, December 15, 2014

Updated quantmod on CRAN

An updated version of quantmod has just been released on CRAN.  This is my first submission as the new maintainer.  The major change was removing the dependency on the now-archived Defaults package.  End-users shouldn't notice a difference, since I basically copied the necessary functionality from Defaults and added it to quantmod.

There are also several bug fixes. A few worth noting are:

Tuesday, November 18, 2014

R/Finance 2015 Call for Papers

Call for Papers:

R/Finance 2015: Applied Finance with R
May 29 and 30, 2015
University of Illinois at Chicago

The seventh annual R/Finance conference for applied finance using R will be held on May 29 and 30, 2015 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 six 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 2015.  This year will include invited keynote presentations by Emanuel Derman, Louis Marascio, Alexander McNeil, and Rishi Narang.

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.

The conference will award two (or more) $1000 prizes for best papers. A submission must be a full paper to be eligible for a best paper award. Extended abstracts, even if a full paper is provided by conference time, are not eligible for a best paper award.  Financial assistance for travel and accommodation may be available to presenters, however requests must be made at the time of submission.  Assistance will be granted at the discretion of the conference committee.

Please make your submission online at: The submission deadline is January 31, 2015. Submitters will be notified via email by February 28, 2015 of acceptance, presentation length, and financial assistance (if requested).

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.

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

Monday, June 30, 2014

R/Finance 2014 Review

It's been more than a month since R/Finance 2014, and my job has finally slowed down enough to allow me to write down my thoughts (though I'm writing this over two days during my train to and from Chicago).

The comments below are based on my personal experience. If I don't comment on a seminar or presentation, it doesn't mean I didn't like it or it wasn't good; it may have been over my head or I may have been distracted with my duties as a committee member. All the currently available conference slides are available on the website.

Friday morning seminar:
I went to Dirk Eddelbuettel's seminar because I may be writing a R package to query Deltix's TimeBase database. Deltix provides a C++ API, so this is a perfect opportunity to use Rcpp.

Friday talks:
The first presentation was given by keynote Luke Tierney, who discussed recent and upcoming performance improvements to R, and introduced some new profiling tools in his proftools package (and a new proftools-GUI package).

Yang Lu explored the low-risk anomaly on high/low volatility portfolios with similar industry, size, and volume. Avery Moon discussed how they use R at Wealthfront to run cashflow simulations for their tax-loss harvesting strategy. Steven Pav used math and memes to discuss portfolio inference. Tobias Setz used the Bayesian Change Point method to analyze time series stability.

Paul Teetor and Matthew Clegg discussed different aspects of pairs trading. Kent Hoxsey demonstrated a simple way to explore trading signal expectation. Matthew Barry introduced the pbo package, which implements some of the ideas in the paper, The Probability of Backtest Overfitting.

Alexios Ghalanos was the day's second keynote, and he discussed smooth transition autoregressive models and his new package, twinkle. Alexios wrote a post discussing his presentation, which you should definitely read.

Friday food/networking:
During the two-hour conference reception at UIC, I had some drinks and hors d'ouvres, talked with speakers, and meet people I encouraged to attend and/or present. Next was the (optional) dinner at The Terrace at Trump. It was cold and windy again this year, so we were inside the entire night. Same as last year, the food was fantastic, but the conversations were even better.

Saturday talks:
The first presentation was a lightning talk by Chirag Anand, where he introduced the eventstudies package, which is very well done. Casey King gave an incredibly informative and entertaining presentation on anti-money laundering and suspicious activity reporting in penny stocks using message board posts. Bryan Lewis introduced his IRL package and ran a 16 million node network analysis in < 2 minutes on his Chromebook, during his talk. Stephen Rush discussed his work on VPIN (volume synchronized probability of informed trading), while competing with Steven Pav for the "presentation with the most memes".

Bob McDonald gave the third keynote presentation, where he discussed using R to teach derivatives in MBA classes. He also explained his decision to adopt R in terms of valuing an option. Eric Zivot discussed his upcoming book, "Modeling Financial Time Series with S-Plus R". Rohini Grover measured the imprecision of implied volatility estimates in volatility indexes using the ifrogs package.

Bill Cleveland gave the final keynote and talked about the "divide-and-recombine" method for large, complex data, using R and Hadoop. Gregor Kastner introduced his stochvol package, and Matthew Dixon showed how to calibrate stochastic volatility models using his "alpha" gpusvcalibration package. Dirk Eddelbuettel closed the conference with a lightning talk on his recently-released RcppRedis package.

The committee also presented the awards for best papers. The winners were:
  • Portfolio inference with this one weird trick, Steven E. Pav
  • Dealing with Stochastic Volatility in Time Series Using the R Package stochvol, Gregor Kastner
  • Re-Evaluation of the Low-Risk Anomaly in Finance via Matching, Yang Lu, Daniel Wu, Kwok Yu
  • All words are not equal: Sentiment dynamics and information content within CEO letters, Kris Boudt, James Thewissen
Saturday food/networking:
As always, the conference ended with one more trip to Jaks Tap. I spent some time giving college students some advice about starting their careers, and discussed the presentation I gave earlier in the week at the Chicago R User Group on Profiling for Speed.

Last, but not least: none of this would be possible without the support of fantastic sponsors:
International Center for Futures and Derivatives at UIC, Revolution Analytics, MS-Computational Finance at University of Washington, OneMarketData, RStudio, TIBCO, SYMMS, and paradigm4.