[R-SIG-Finance] Compiling R code / java trading framework

Pierre-Alexandre p.desmazis at gmail.com
Fri Mar 16 21:34:46 CET 2012

Hi everyone,

R is a very nice tool to elaborate complex trading strategies and pretty quickly. 

Nevertheless as the portfolio of strategies grows it becomes more and more time consuming to calculate the positions to execute.

Also I found it difficult to create a robust trading framework based on R. For example in many language it is much more easy to handle large number of files and classes (UML modelling, MVC, convention over configuration, repository....).

My question is in two parts. 

1- How would you structure your code so it stays manageable when you have a very large number of function and tools. In this field R is ok for short code but when it comes to manage trading platform it is very quickly a mess. so you have any good example of trading frameworks in R (or R combined with other languages)

2- to increase speed I saw that it should be possible to compile the code written in R since R 2.13. Do you confirm? Would you recommend that and do you have any tutorial or example on how to do that ?

In the end I was thinking about back testing in R and then recoding the strategies in another more structured and fast Langage like java for execution. 

But I think it is time consuming and it is a very bad idea  to recode your backtest in the end because it is going to create many discrepancies and errors.

Let me know what you think

Thank you

More information about the R-SIG-Finance mailing list