An updated version of xts is now on CRAN . The most notable change is that plot.xts() now supports a log scale y-axis. This involved a significant refactor of the plot.xts() internals, so it’s possible to have introduced some bugs. Features Add ability to log scale the y-axis in plot.xts() . ( #103 ) Significantly refactor the internals of plot.xts() . This made it a lot easier to add the…
This post extends the replication from the Adaptive Asset Allocation Replication post by running the analysis on OOS (out-of-sample) data from 2015 through 2023. Thanks to Dale Rosenthal for helpful comments. The paper uses the 5 portfolios below. Each section of this post will give a short description of the portfolio construction and then focus on comparing the OOS results with the replicated…
The paper, “Adaptive Asset Allocation: A Primer” by Adam Butler, Mike Philbrick, Rodrigo Gordillo, and David Varadi addresses flaws in the traditional application of Modern Portfolio Theory related to Strategic Asset Allocation. It shows that estimating return and (co)variance parameters over shorter time horizons are superior to estimates over long-term horizons because parameter…
An updated version of quantmod is now on CRAN . It includes an awesome new feature that allows you to import up to 7 days of intraday data from Yahoo Finance! New Features getSymbols.yahoo() can import up to 7 days of intraday data! Thanks to @kapsner for the report and patch! ( #351 , #381 ) It will throw a warning if you try to request more than 7 days of intraday data, but you can suppress the…
This is the second post in the series on using TimeBase to stream real-time market data. This post covers using Docker to run TimeBase and the TimeBase Web Administrator . Getting Started Docker installation and configuration is outside the scope of this post. Docker has a Get Started page to help you get set up. I’ll be using Docker via Ubuntu and the command line interface. I know this…
This is the first post of a series on using TimeBase to stream real-time market data. TimeBase is a high performance event-based time series database and message broker. I used it on a proprietary trading desk that made markets in futures, and currently use it to build and test equity trading strategies. It was released as open-source in February 2021. Preface I am not affiliated with the company…
quantmod and getSymbols() have been a core part of the R/Finance ecosystem for over 15 years. We want to change some things, but they would break existing code. We can make these changes in the new ‘rfimport’ package instead. Background The quantmod package has been a core part of the R/Finance ecosystem for over 15 years. It’s awesome that the package is so popular, but that…
An updated version of xts is now on CRAN . This release patches a few issues with the features added in version 0.13.0 and addresses a few maintenance issues that popped up recently. Patches for features added in 0.13.0 Format each column individually before printing. The top/bottom rows could have a different number of decimal places and there are often multiple varying spaces between columns.…
An updated version of quantmod is now on CRAN . It adds functions HL() , is.HL() , and has.HL() to check for ‘high’ and ’low’ price columns. It also makes accessing Yahoo Finance price, dividend, and split data more robust. getSymbols.FRED() got to and from arguments, like other getSymbols() methods. The remaining changes are bug fixes and maintenace chores. This was mainly…
An updated version of xts is now on CRAN . This release adds several exciting changes: open-ended time-of-day subsetting, smarter conversions to xts from data.frames/data.tables/tibbles; to.period() handles custom endpoint values, print() truncates rows like data.table, and str() provides more informative output. There are also changes to make xts more consistent with zoo, some minor speed…
An updated version of xts is now on CRAN . This release is a big one, with lots of changes. Plotting functionality got a lot of attention. Another notable change is that merge.xts() now supports suffixes. Plus the obligatory bug fixes and refinements to make xts more robust. Plotting functionality enhancements and bug fixes You can now omit the data time range from the upper-right portion of a…
I follow Quantocracy on Twitter , and I found Rolling mean correlation in the tidyverse by Robot Wealth . They say to let them know if you’d approach it differently. I would, so I thought it would be interesting to replicate the analysis using tools I’m familiar with: xts and TTR . The xts package is an extension of the very excellent zoo package. zoo objects are for ordered…
An updated version of xts reached CRAN on 2020-09-09. Time-of-day subsetting (e.g. x["T10:00/T13:00"] ) is 200x faster! (This post includes some notes on some nifty changes in 0.12.0 too, since I didn’t post about 0.12.0 when it was released.) This is a long-overdue post. I’m trying to get int the habit of posting and announcing each of my package releases. So I’m writing posts…
An updated version of TTR is on CRAN now. This is mainly a bug-fix release. There were several issues in the underlying C code that caused various issues. I’ll spare you the gory details. If you’re really interested, you can find them in the CHANGES file. [This is another one of my long-overdue posts. I’m trying to get int the habit of posting and announcing each of my package…
A new version of quantmod is on CRAN ! One really cool thing about this release is that almost all the changes are contributions from the community. Ethan Smith made more excellent contributions to getQuote() in this release. It no longer throws an error if one or more symbols are missing. And it handles multiple symbols in a semicolon-delimted string, just like getSymbols() . For example, you can…
I pushed an updated microbenchmark to CRAN a couple weeks ago. There were two noteworthy changes, thanks to great contributions from @MichaelChirico and @harvey131 . Michael fixed a bug in the check for whether the unit argument was a character string ( #9 , #10 ). The prior behavior was an uninformative error. Harvey added a feature to allow you to use a string for common checks:…
I just pushed a new release of quantmod to CRAN ! getSymbols() no longer stops if there’s a problem with a ticker symbol. And getQuote() can now import quotes from Tiingo . 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…
xts version 0.11-2 was published to CRAN yesterday. This is quick a bug-fix release. Notable changes are 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…
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…
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…
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…
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 .…
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.…
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…
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…
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…
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…
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…
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…
I assume that you’re reading this because you are one of many people who were affected by the changes to Yahoo Finance data in May (2017). Not only did the URL change, but the actual data changed as well! The most noticeable difference is that the adjusted close column is now only split-adjusted, whereas it used to be split- and dividend-adjusted. Another oddity is that only the close prices…
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…
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…
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…
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…
The team at DataCamp announced a new R/Finance course series in a recent email: Subject: Data Mining Tutorial, R/Finance course series, and more! R/Finance - A new course series in the works We are working on a whole new course series on applied finance using R. This new series will cover topics such as time series (David S. Matteson), portfolio analysis (Kris Boudt), the xts and zoo packages…
You can find registration information and agenda details 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 6, 2016. The conference will take place on May 20 and 21, at UIC in Chicago. Building on the success of the previous conferences in 2009-2015, we expect more than 250…
This post is in response to Michael Harris’ Price Action Lab post , where he uses some simple R code to evaluate the asymmetry of returns from the day’s close to the following day’s open. I’d like to respond to his 3 notes, which I’ve included below. The R backtest assumes fractional shares. This means that equity is fully invested at each new position. This is…
I just sent quantmod_0.4-5 to CRAN , and TTR_0.23-0 has been there for a couple weeks. I’d like to thank Ivan Popivanov for many useful reports and patches to TTR. He provided patches to add HMA() (Hull MA), ALMA() , and ultimateOscillator() functions. James Toll provided a patch to the volatility() function that uses a zero mean (instead of the sample mean) in close-to-close volatility. The…
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…
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…
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 getOptionChain.yahoo and getSymbols.oanda . Changes to the Yahoo Finance and Oanda websites broke the getOptionChain.yahoo and getSymbols.oanda functions, respectively. I didn’t use getOptionChain.yahoo much, so I’m not certain I restored all the…
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…
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:…
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,…
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;…
This is a guest post by Ross Bennett. Ross is currently enrolled in the University of Washington Master of Science in Computational Finance & Risk Management program with an expected graduation date of December 2014. He worked on the PortfolioAnalytics package as part of the Google Summer of Code 2013 project and continues to work on the package as a Research Assistant at the University of…
As announced on the R-SIG-Finance mailing list, registration for R/Finance 2014 is now open ! The conference will take place May 17 and 18 in Chicago. Building on the success of the previous conferences in 2009-2013, 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…
The complaint I hear most frequently about quantstrat is that it’s slow, especially for large data. Some of this slow performance is due to quantstrat treating all strategies as path-dependent by default. Path dependence requires rules to be re-evaluated for each timestamp with a signal. More signals equates to longer run-times. If your strategy is not path-dependent, you can get a fairly…
We’re getting ready for this year’s R/Finance conference. Here’s the call for papers. I hope to see you there! R/Finance 2014: Applied Finance with R May 16 and 17, 2014 University of Illinois at Chicago The sixth annual R/Finance conference for applied finance using R will be held on May 16 and 17, 2014 in Chicago, IL, USA at the University of Illinois at Chicago . The…
It’s been one week since the 5th Annual R/Finance conference , and I finally feel sufficiently recovered enough to share my thoughts. The conference is a two-day whirlwind of applied quantitative finance, fantastic networking, and general geekery. The comments below are based on my personal experience. If I don’t comment on a seminar or presentation, it doesn’t mean I…