To continue with the LSPM examples, this post shows how to optimize a Leverage Space Portfolio for the maximum probability of profit. The data and example are again taken from The Leverage Space Trading Model by Ralph Vince.
These optimizations take a very long time. 100 iterations on a 10-core Amazon EC2 cluster took 21 hours. Again, the results will not necessarily match the book because of differences between DEoptim and Ralph’s genetic algorithm and because there are multiple possible paths one can take through leverage space that will achieve similar results.
An updated version of TTR is now on CRAN. It fixes a couple bugs and includes a couple handy tweaks. Here’s the full contents of the CHANGES file:
TTR version 0.20-2
Changes from version 0.20-1
NEW FEATURES:
Added VWAP() and VWMA() (thanks to Brian Peterson) Added v-factor generalization to DEMA() (thanks to John Gavin) CHANGES:
Updated volatility() to handle univariate case of calc='close' (thanks to Cedrick Johnson) Moved EMA(), SAR(), and wilderSum() from .
In November, I used the strategy in Mebane Faber’s Tactical Asset Allocation paper to provide an introduction to blotter. Faber has updated the strategy’s results through the end of 2009. For those interested, he expands on the paper in his book, The Ivy Portfolio.
As posted by Dirk Eddelbuettel on R-SIG-Finance:
R / Finance 2010: Applied Finance with R
April 16 & 17, Chicago, IL, US
The second annual R / Finance conference for applied finance using R, the premier free software system for statistical computation and graphics, will be held this spring in Chicago, IL, USA on Friday April 16 and Saturday April 17.
Building on the success of the inaugural R / Finance 2009 event, this two-day conference will cover topics as diverse as portfolio theory, time-series analysis, as well as advanced risk tools, high-performance computing, and econometrics.
My last post provided examples of how to use the LSPM package. Those who experimented with the code have probably found that constrained optimizations with horizon > 6 have long run-times (when calc.max >= horizon).
This post will illustrate how the snow package can increase the speed of the probDrawdown() and probRuin() functions on computers with multiple cores. This yields nearly linear improvements in run-times relative to the number of cores.
I have received several requests for additional LSPM documentation over the past couple days and a couple months ago I promised an introduction to LSPM.
In this long-overdue post, I will show how to optimize a Leverage Space Portfolio with the LSPM package. Please use the comments to let me know what you would like to see next.
Some copious notes before we get to the code:
These examples are based on revision 26 31 from r-forge and will not work under earlier revisions (and may not work with later revisions).
NOTE: If you simply want to test strategies in R, please see the post: Tactical Asset Allocation Using quantstrat. quantstrat uses blotter behind the scenes, but provides a higher level of abstraction.
blotter is an R package that tracks the P&L of your trading systems (or simulations), even if your portfolio spans many security types and/or currencies. This post uses blotter to track a simple two-ETF trading system.
The contents of this post borrow heavily from code and comments in the “longtrend” demo script in the blotter package.
I’ve been getting a bit of traffic from people searching for opentick (the defunct company), so I’ve started a list of similar (but non-free) data providers.
I’m not affiliated with any of these vendors, and the list is in no particular order. I’ll update this post as more information becomes available.
IQFeed
- features, fees, API**
- starts at $60/month*
- OS: Windows
- Same API as DTN.IQ
eSignal
- features, fees, API**
Six months after shutting down opentick completely Xasax (opentick’s parent company) has followed suit.
It looks like Xasax hit funding problems in August… Inside Market Data mentions the above in this story. Here is the full story (subscription required).
I can’t believe it’s been two months since I last posted… wow, time has a way of slipping through my fingers. Here’s a short list of some upcoming posts:
An introduction to LSPM – a new R package that implements Ralph Vince’s leverage space portfolio model (co-authored with Soren Macbeth). Updated charting with quantmod. An introduction to blotter – a transaction-based infrastructure for trading systems and simulation, providing support for multi-asset class and multi-currency portfolios.