[Need Advise] Language for strategy development (R, Python or VB.NET)

Discussion in 'App Development' started by brianchan, Jul 24, 2014.

  1. brianchan

    brianchan

    Hi all

    I am new to trading and would like to ask some questions.

    I am developing my backtesting platform by VB.NET.


    Before coding the whole strategy into the VB.NET, would it be more efficient to prototype the strategy first in R or Python?

    I am considering the strategy development speed between R, Python and VB.NET

    I have some very basic knowledge to R, but it seems to be statistical-like.
    So I am considering whether Python would be better because it is more "general-purpose".


    Thanks a lot for all of your suggestion and comments
     
  2. Generally you use R for finding patterns in the historical prices.

    One you found those patterns then code them in a language that is compatible with
    your broker API
     
  3. jcl366

    jcl366

    Python would be far more efficient, but why do you need a different language for prototyping? If your strategies run in VB.Net, why not prototype them in VB already?

    Here's a speed comparison of languages:

    http://attractivechaos.github.io/plb/
     
  4. Baron

    Baron ET Founder

    I always heard that Ruby was slow but never realized just how slow it is until I just saw those speed comparisons.
     
  5. brianchan

    brianchan

    Thanks a lot

    My main concern is the development speed. It seems that finding the pattern in R or Python is faster, but protyping may not save me time
     
  6. vicirek

    vicirek

    First you have to define the problem that you are trying to solve and what is the meaning of "strategy" in terms of algorithm design or in terms of either TA, stats, ML etc. being considered as building blocks of the algorithm.

    Any computer language consists of core language and libraries.

    R is the easiest to use and fastest to implement prototyping because it has 4000 libraries handy with out of the box graphics and in my opinion it is based on very clever core concepts of computer science.

    Similar to R is Python with rich libraries but it takes longer to learn and requires more work to put together working program.

    VB is general purpose programming language.There are libraries written in .Net (mostly in C#) that can be referenced and used in any .NET code but those are scattered all over the internet with some download managers like NuGet that can help to find and install them.

    The problem with libraries is that in many instances they are black box solutions especially if you are not a programmer and cannot understand the code (which is in many instances open sourced) and would not be able to translate it. Libraries from different languages can be cross referenced but it can be very painful to do it.

    At this stage of the game when you just declared that it is fishing expedition I would recommend R to start work and in addition learn general purpose computer language. VB is fine (I do some work using it for fast prototyping) but in general C# is preferred due to better support, rich literature, libraries and large community of developers that can offer help. Nothing beats knowing C++ (not necessarily building programs with it) but I am not sure how much work you are willing to put into the project so it might not be the best route to go at t his time.
     
  7. Most those performance runs date back to 2011. Also keep in mind that most likely some Linux/Unix user put up those tests grossly ignoring that .Net code runs a lot faster on Windows than Linux due to the fact that the newest Mono versions do not incorporate the newest .Net libraries and more importantly Mono has much worse memory management than Windows .Net [example, Mono accesses hard drive cache / swap space much more often than native .Net which is a lot less efficient]. Also keep in mind that among the top contenders (C, C++, Java, .Net) .Net has made the most improvements in the past 2-3 years in terms of performance and memory allocations. One other thing, but I do not hold that against the author, is that the newest .Net Roslyn compiler platform again lends quite a bit of performance opportunities to .Net whereas I have hardly see any improvements on the C, C++ or Java side over the past year or so. I am not hyping C# or other .Net brethrens though I think it should be fair.

     
  8. that I would ever hear such statement regarding C# from you is a shocker ;-)


     
  9. vicirek

    vicirek

    My opinion on C# and .Net itself did not change so I am expressing the same but it could be that it was discussed in a different context.

    One thing about C# and .Net to know is that it is definitely closely tied to Microsoft which is not always being predictable what they are going to come up with next.

    Another words it is not open standard independent of commercial vendor/s.

    I do not think that OP wants to become full time programmer nor is looking for high performance computing/fastest language but is rather looking for efficient and speedy way to implement limited coding skills to test his ideas and observations about markets potentially using code already available in public domain.
     
  10. R is the best of the 3 languages for doing any heavy statistics work, but lacks as a general programming language... (performance is not its forte). Python and C# are pretty evenly matched, in terms of performance and verbosity.
    Python's numpy and pandas libraries may give it some edge when it comes to data analysis, Im not sure if .NET has something similar (maybe volpunter can pointed out)
     
    #10     Jul 25, 2014