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 substantial performance improvement by turning path-dependence off. If your strategy truly is path-dependent, keep reading…
I am trying to run this script in R-Studio on OSX … Lemao - Aug 2, 2011I am trying to run this script in R-Studio on OSX but I am getting the following error: > currency(“USD”) Error in assign(primary_id, currency_temp, envir = as.environment(.instrument)) : object ‘.instrument’ not found I have installed the dependencies: zoo, xts, TTR, RTAQ, quantstrat, quantmod, Performanceanalytics, FInancialInstrument, Defaults and blotter. Any ideas of what is going wrong here?
As promised in the introduction to quantstrat, here is an example strategy. I thought I’d start with the obligatory tactial asset allocation (TAA) strategy. This post will replicate the strategy in the post, tactical asset allocation using blotter. The “faber” demo in the quanstrat package contains a TAA strategy but it uses a slightly different approach than the code we’re trying to replicate. There are two major differences: The blotter TAA code initiates a position at the first observation where the close is above the SMA.
Great idea, Josh. I’m looking forward to seein… Alexis Petit - Aug 5, 2011Great idea, Josh. I’m looking forward to seeing the next posts! I think this will help many of us make a better use of Quantstrat. Many thanks! package quantstrat is not available (for R version 2.13.1) need manual compilation? Thank you for your work, really helpful! From windows: install.packages(“quantstrat”, repos="http://R-Forge.R-project.org”) Installing package(s) into ‘C:/Users/Res1/Documents/R/win-library/2.13’ (as ‘lib’ is unspecified)
quantstrat provides a generic infrastructure to model and backtest signal-based quantitative strategies. It is a high-level abstraction layer (built on xts, FinancialInstrument, blotter, etc.) that allows you to build and test strategies in very few lines of code. quantstrat is still under heavy development but is being used every day on real portfolios. We encourage you to send contributions and test cases to the project forums. This post is a joint effort between me and Brian Peterson.