Anyone up for collaberating on replicating Chan scripts in Python?

Discussion in 'Automated Trading' started by dtrader98, Jul 21, 2009.

  1. rosy2

    rosy2

    post some echan code here and we can port it.

    all the functional languages (ocaml, f#, erlang, lisp) are really only talked about but never used. granted i do like ocaml a lot.
     
    #11     Jul 22, 2009
  2. Well, it's pretty easy to get the code, but I don't want to be in any copyright infringement. If you are really interested to port it, I'll give a simple example I'm working on right now.

    cadf(seq1,seq2,0,1); is the matlab code
    to generate augmented dickey-fuller test on two sequences order 0, lag 1.

    If you could translate to an equivalent function with arguments in Python, that would be great!

    (P.S. There are many other languages to do it, that is not the purpose of this thread/experiment).
     
    #12     Jul 22, 2009
  3. rosy2

    rosy2

  4. Hi Rosy,

    Thanks for sharing some generic links, although I already got that far. I was specifically looking for the CADF.py (or equivalent to matlab.cadf.m) function to be readily instantiated in the form mentioned. If you have a link to that; that would be great.

    Also, I don't want to mix languages (i.e. no calls to R, etc.). The goal is to keep it all py.

    Even better,
    a = ([1,2,3,4,5,6])
    b=([1.2,2.2,3.2,4.2,5.2,6.2])

    could you show an explicit example of these two series being run through a
    cadf.py function with equivalent statistical output to matlab?
     
    #14     Jul 23, 2009
  5. Nevermind, I figured it out. Ended up using unitroot.py functions. Wasn't all that smooth, but getting there. Thanks again.
     
    #15     Jul 23, 2009
  6. Actually, Jane Street Cap use Ocaml - A LOT !
     
    #16     Jul 23, 2009
  7. byteme

    byteme

    Back in 96 and 97 when I was even more of a newb than I am today, I developed a couple of projects in a functional programming language called Miranda (which is probably now dead)....seems these things are back in vogue.

    Could be fun to pick that stuff up again and see how it can be applied in a trading context.
     
    #17     Jul 23, 2009
  8. Just in case anyone gets the urge to work on it, it's doable and a great way to practice Python; although, there are some functions that were not directly translatable (ex. cadf.m != adf.py), nor readily developed. I'll be doing some more translations shortly.
     
    #18     Jul 24, 2009
  9. Think I'll do 3.7 (Mean Reverting) next. Any other requests from the text, and if interesting enough, I'll maybe port over.
     
    #19     Jul 24, 2009
  10. You're right about many of the advantage of python.

    Still, to make it easy to quickly "implement" a trading idea with python (I know python) that will serve a group of people (not just yourself) requires enormous work.

    It's because you need basic plumbing to load and process the data, synchronize it for multi symbol portfolio trading, handle generating bars in multiple time frames, handle processing of various types of orders (simulated unless you're using tick data). If using tick data , you have many months of work to get the performance down to anything acceptable.... the list goes on and on and on.

    I want to propose to you a possibly simpler and quicker option to use python.

    Have you heard of IronPython? It's a free python implementation which runs on .NET instead of the python parser. That means it's fully compatible with C#, VB, etc.

    That also means it can interact with already existing C# objects and so on.

    It would be so cool to interactively write a couple trading ideas, run them and 10 different symbols with some portfolio % allocation and have them run and a chart pops up that you can dynamically examine with performance stats, etc.

    Well, some people have suggested adding python to the tickzoom project.

    That's because it's open source. Has the platform separate from the GUI as an API and the data engine also separate again as an API.

    One hedge fund, for example is bypassing the tz GUI and using the platform as a black box programmatically with their own GUI and server systems.

    The best way to integrate tickzoom into Python would be to do it using IronPython which runs on Windows and Linux.

    Tickzoom already has all those facilities and plumbing described above (and many more) for historical testing, optimizing, replay and easy switch to live trading.

    Of course, no actual paying users of tickzoom as requested python but it's on my list only because I find the idea very interesting and geeky personally.

    If you're at all interested in doing this and thing integrating with TickZoom would suit your purposes, I would be interested in contributing to your effort.

    If you think we can do it, I'll give you the exclusive opportunity to using the free trial as long as we need to get python working on tickzoom. If you get it working, I'll give you a free license so you can run it live.

    I think the market for this financially is very, very small--almost non-existent. I'm only offering this because it's very interesting technically and "geeky" so I'll be happy to support you however I can to do this.

    If you want to discuss further, just sign up on the waiting list (on my signature) and reply to the emails--that's my real personal email used for the list. I don't get PMs or email notification on elitetrader.

    Wayne
     
    #20     Jul 25, 2009