R

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.

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.

getSymbols and Alpha Vantage

Thanks to Paul Teetor, getSymbols() can now import data from Alpha Vantage!  This feature is part of the quantmod 0.4-11 release, and provides another another data source to avoid any Yahoo Finance API changes*.

Alpha Vantage is a free web service that provides real-time and historical equity data.  They provide daily, weekly, and monthly history for both domestic and international markets, with up to 20 years of history. Dividend and split adjusted close prices are available for daily data. They also provide near real-time price bars at a resolution of 1 minute or more, for up to 10 recent days.

xts 0.10-0 on CRAN!

A new, and long overdue, release of xts is now on CRAN!  The major change is the completely new plot.xts() written by Michael Weylandt and Ross Bennett, and which is based on Jeff Ryan’s quantmod::chart_Series() code.

Do 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.  And I will no longer have to tell people that I use plot.zoo() on xts objects!

Importing and managing financial data

I’m excited to announce my DataCamp course on importing and managing financial data in R! I’m also honored that it is included in DataCamp’s Quantitative Analyst with R Career Track!

You can explore the first chapter for free, so be sure to check it out!

Course Description

Financial and economic time series data come in various shapes, sizes, and periodicities. Getting the data into R can be stressful and time-consuming, especially when you need to merge data from several different sources into one data set. This course covers importing data from local files as well as from internet sources.

quantmod 0.4-9 on CRAN

A new release of quantmod is now on CRAN! The only change was to address changes to Yahoo! Finance and their effects on getSymbols.yahoo().  GitHub issue #157 contains some details about the fix implementation.

Unfortunately, the URL wasn’t the only thing that changed.  The actual data available for download changed as well.

The most noticeable difference is that the adjusted close column is no longer dividend-adjusted (i.e. it’s only split-adjusted).  Also, only the close price is unadjusted; the open, high, and low are split-adjusted.

quantmod 0.4-8 on CRAN

I pushed a bug-fix release of quantmod to CRAN last night. The major changes were to

  • getSymbols.FRED() (#141)
  • getSymbols.oanda() (#144)
  • getSymbols.yahoo() (#149)

All three providers made breaking changes to their URLs/interfaces.

getSymbols.google() also got some love. It now honors all arguments set via setSymbolLookup() (#138), and it correctly parses the date column in non-English locales (#140).

There’s a handy new argument to getDividends(): split.adjust. It allows you to request dividends unadjusted for splits (#128). Yahoo provides split-adjusted dividends, so you previously had to manually unadjust them for splits if you wanted the original raw values. To import the raw unadjusted dividends, just call:

Stack Financials: Analyze Financial Statement Data

A quantmod user asked an interesting question on StackOverflow: Looping viewFinancials from quantmod. Basically, they wanted to create a data.frame that contained financial statement data for several companies for several years. I answered their question, and thought others might find the function I wrote useful… hence, this post!

I called the function stackFinancials() because it would use getFinancials() and viewFinancials() to pull financial statement data for multiple symbols, and stack them together in long form. I chose a long data format because I don’t know whether the output of viewFinancials() always has the same number of rows and columns for a given type and period. The long format makes it easy to put all the data in one object.

R/Finance 2017: Call for Papers

R/Finance 2017: Applied Finance with R

May 19 and 20, 2017

University of Illinois at Chicago

The ninth annual R/Finance conference for applied finance using R will be held on May 19 and 20, 2017 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.

quantmod 0.4-6 on CRAN

CRAN just accepted a bugfix release of quantmod.  The most pertinent changes were to fix getSymbols.oanda (#36) and getOptionChain.yahoo (#92).  It also includes a fix to addTRIX (#72).

Oanda changed their URL format from http to https, and getSymbols.oanda did not follow the redirect.  Yahoo Finance changed the HTML for displaying options data, which broke getOptionChain.yahoo.  The fix downloads JSON instead of scraping HTML, so hopefully it will be less likely to break.  For more information, see the links to the GitHub issues above.