Automated Trading with 'R' and Interactive Brokers
"Dear old Future, be so nice, let us know tomorrow's price"




What is it?   'QSIBLIVE' is a collection of R scripts that will enable you to use a trading strategy developed in the backtesting evironment 'quantstrat' for live trading with Interactive Brokers. Only the free 'R' environment is required. 'QSIBLIVE' is built on top of two great R packages,'quantstrat' and 'IBrokers'. For details, see the README.

What can it do?   It can show you how to deploy a tested and hopefully robust and profitable trading strategy to the market, with R alone. The public version is limited to End-Of-Day trading based on daily Close prices. For now it only supports trading a single instrument, not a portfolio of instruments. But you can launch as many instances of it as you like and therefore effectively trade a portfolio of single instruments, using either the same strategy or a different one on each instrument. This public version should not be used for unsupervised trading. But I think it can give you an idea how to create your own solution. One that you feel comfortable with and trust.

Why is this useful?   Well, there are many nice pieces of software that connect to the IB Trader Workstation,some of which can be used for automated trading. Some are even freeware. None or very few of them however offer the power, flexibility and community support of the 'R' project. Besides, R has really an amazing repository of free and very adavanced statistical packages, something you will find very useful if you trade using quantitative methods. All I am trying to do here is bring R a bit closer to the market, without having to use any middleware such as Java,Python, etc.


WARNING: This code is in constant development. The public version has not been optimized nor has it been cleaned of unnecessary comments and should NOT be used with a production IB account. I recommend that you use it for test-trading with an IB PAPER account only. Also note that the required 'quantstrat' package is itself,as stated by the authors, a development package and therefore not necessarily stable enough for untested deployment to a production environment.WARNING:



Variants of QSIBLIVE have been optimized for intraday trading and for the execution of particular strategy types. These are in various stages of development,testing or production and available under a proprietary license upon request and for a small fee. Just send me an email.



QSIBLIVE Downloads:
qsiblive-public-license-1.5-UNSTABLE.tar.gz - 4. August 2012 - (README)
*NOTE*: The above download is is only here for historical reasons. It is highly unstable and may not run at all since I have not had the time to adapt it to work with the latest and greatest versions of the other R packages it depends on. Running it requires the old 'quantstrat' package version 0.3.2 (currently at 0.6.8) and the equally outdated 'FinancialInstrument' package version 0.4 (currently at 0.15.2) and even then you may encounter issues. The main reason for the incompatibility with more current versions is that changes to the orderbook structure were made by the quantstrat developers and the fact that the .instrument environment created by the FinancialInstrument package is not accessible from the global environment anymore. If you are interested in obtaining some more hints on how to make it work, get in touch via email.

Links
How to create strategies and backtest them in quantstrat:
http://www.scribd.com/doc/117816588/3/The-quantstrat-package
http://timelyportfolio.blogspot.com/


Soren Wilkening (Dipl.Math.)
 
LinkedIn
Coursera.org






Quote: "It's not pretty, but it works"