Ruby programming

Discussion in 'Automated Trading' started by Nashequilibrium, Mar 15, 2010.

  1. That sounds quite reasonable. Thanks for taking the time and sharing.
     
    #21     Apr 18, 2010
  2. COOL, explanation!!
     
    #22     Apr 19, 2010
  3. OP can make a mental note -- when his firm grows to $1b+ market value, he'll need to reengineer.
     
    #23     Apr 30, 2010
  4. Swarm

    Swarm

    Wrappers around C/C++ libraries only get you so far with performance. As an example, I'm doing evolutionary computing where the evolution invokes a 'fitness function' for every individual on every generation. The fitness function has to be bespoke and isn't in any library although the library could do the evolutionary stuff. Currently it's doing a billion evaluations a minute and it still takes a weeks worth of processing on a quad core CPU to come up with a strategy that's worth trading.

    Needless to say it's implemented in C and very tightly integrated to the library in order to maximise any possibilities for reusing partial computations.

    You couldn't do that in Ruby unless you had a very large hardware and power budget. And what's the point, it will only take me twice as long to write it in C.

    I have another issue with Ruby which is dynamic typing. It's great for noddy web applications where you can test to destruction to find all of the numerous errors but for finance it's a disaster.

    In my code I will often not know whether I've implemented it correctly or not since it's using learning - it will naturally find a way around a badly implemented function that provides no benefit. So I need as much 'correctness' built into the development process as possible so that I then don't waste CPU cycles trying to evolve strategies against junk indicators and functions. Even strict typing in C/C++ is not adequate for this and I have spent many hours and days trying to find stuff that was needlessly wrong. Dynamic typing would make this much worse.

    I'm now looking to move as much code as possible to Haskell because the type system is far stricter than C and purity helps ensure correctness as well. It will take me longer to write it in Haskell because you need to think harder, although there will be less code, and it will probably run 2-3 x slower than C but it should save in the overall time because bugs will be fewer.

    I have used Ruby and I can see it's attractions, but my personal view is that, in this game, correctness is very important and performance is often a strong consideration.

    If you like Ruby, you'll probably like Scheme also dynamically typed but compiled and integrates well with C. I've tried various languages looking for the perfect candidate but I always come back to C, for speed, and try and use Haskell for everything else.

    The major issues that you'll have using anything other than C# is integration with trading platforms which ultimately is the point of the activity.
     
    #24     Sep 15, 2010
  5. If you are interested in programming PM ME. I'm familiar w/ Laser, Sterling, IB, and Lightspeed, and learning others is pretty much easy

    I am flexible. I am willing to do it for free providing I can get some equity, or I can charge.
     
    #25     Sep 15, 2010
  6. Are you using either package successfully? Latest activity seems to be in Jun 2004 http://sn.im/13f53c and Jan 2007 http://sn.im/13f55c, respectively.
     
    #26     Sep 15, 2010
  7. I found Ruby too slow for my trading system. However I think all scripting languages will have this problem,not just Ruby.
     
    #27     Sep 16, 2010
  8. Corey

    Corey

    Used rsruby successfully, but it doesn't seem to work well with Rails, which I tend to use as a front-end. I've successfully found my way around using it though...
     
    #28     Sep 16, 2010
  9. Raul641

    Raul641

    I made a free and open source Ruby interface to interactive Brokers' TWS API that some of you might find useful. The latest version is at http://github.com/pjlegato/ib-ruby .

    Also, in response to a question above, I've used rsruby for some time now without any major issues.


    R
     
    #29     Sep 17, 2010