Building Portfolio with R-Project..

Discussion in 'Strategy Development' started by Surfeur, May 23, 2008.

  1. Surfeur


    Hi all,

    I need advices :)

    I expose you my problematic.

    I want use R-project software for my trading and selection & weight of your systems.

    That is to say that I have several systems trading on the Forex with UT and various symbols. My pool of system is about 60 systems available.

    My goal in r-project is to build over these 60 systems, a Long & short portfolio of 30 systems "only" and refresh or reoptimize weekly or monthly period.

    I do not really know how to go about it to find the 30 best systems for my portfolio.

    I intend to recover the daily return as a percentage of each system and store the result in a mysql database. (That works correctly)

    The problem that I am a little lost :(

    At the moment I read a lot of stuff on the subject .. Efficient frontier, MV portfolio etc etc but for putting into practice is another thing :(

    Can you help me to put into practice with examples of script that you can use in selecting your portfolio ?

    Best Regads.
  2. Surfeur


    any comment !?


    I can't find a few help here !?
  3. of all the things in the world why use R-Project?

    a growing theme in trading and finance is the fetish of computer programming and technology. while it is proven with some amazing results (only in the hands of very talented few) it serves no more than a voyeuric fantasy in the imagination of the typical bob and harry who think it's the golden key to success. funny enough they become more obsessed with technology and coding than trading itself.

    many people lack the most basic managerial skills. u give them very simply tasks and most of them want to make it complicated or complete it in a certain way, while the richest woman in china recycles paper..

    so why R? if u give me a seriously good reply I might waste more time on the topic..
  4. Surfeur



    All it seems to me simply that the program r-project with the finance packages available can help me resolve my problem construction of portfolio.

    By cons if you know another method is as effective and easiest I am willing to listen. :)



  5. R in my view is too slow and the necessary work required to put in into place just for a basic system/application makes it useless.

    as far as finance packages go, whats your background? explain to me one of the packages on that link that ur interested in and how it's going to help you. what's your view of GARCH modelling? r u just interested in 'packages or have a good theoretical understanding of what u want to achieve.

    a far far better way forward is to use a real oop like c++, c#, java or delphi to work on your project. they offer so much more, so much easier, faster with tons of math libraries available. remember those 'packages' are the basic of any stat text book. u can't really play with them seriously, unless u want to write up ur own packages.

    a few people do say R is a good tool for finance but it's not. they probably haven't tested anything else or might not have even used R! It just looks good.
  6. Well I think thats being a little harsh towards R but I understand your point. I think its more a problem of trying to build a nuclear bomb to bring to a knife fight if your trading retail by yourself.
    I would think you would want to look to Matlab for this, it should require much less grunt work than R or programming everything yourself in a real language.
  7. Surfeur


    I'am Unix/Linux Admin sys and i don't have any background in finance... :(

    I think use this packages > fPortfolio,quadprog,PerformanceAnalytics and tseries

    The GARCH modelling are used for predict the volatility it seems to me..

    It's the model than you use ?

    For the c++ or something... I don't want start from scratch for developping my application .. it's too complex and need more time than start with r-project or matlab...

    Thanks for you input batman.

  8. Surfeur


    Thanks jdeezero05 but i think than matlab or R it's the same fight... :D

  9. nitro


  10. Euler


    I agree that R won't do well with huge data sets. R's relative slowness in such cases has very little to do with the actual floating-point computations -- rather, it's spending so much time shuffling its native data structures. R's data structures lead to really nice representations in many cases, but at a cost as the data grow.

    On the other hand, R has an unparalleled number of freely available statistical tests that are probably never implemented in any other language, as it's often the first language stat academics use to implement a new idea.

    One reason for its popularity as such is that R can have a very succinct representation of what would otherwise be much longer code in certain other languages. Black Scholes, for instance, is like 50 characters long in R; I haven't seen it represented that compactly in other languages.

    So whether or not it's a good solution depends on how much data you're working with. If it's a small amount (thousands of data points, max, rather than millions or billions), it's probably a good choice; otherwise, you'll likely need to go to a faster-running language.
    #10     May 26, 2008