modify an exising automated trading package or build a new one ?

Discussion in 'Automated Trading' started by ecoscien, Dec 28, 2005.

  1. ecoscien

    ecoscien

    Does anyone know whether it is easy to write your own indicators that does some more complicated statistical analysis ( is it doable in Easylanguage?) and then put that in an automated trading software package(commercially available ones)? Is there any good auto-trading package out there that allows that?

    Or it is better (and not too much more work) to just write a new automated trading algorithm (in C++?). How complicated will the program be? Are there any source codes that one can start with and modify?

    Thanks a lot for any inputs.
     
  2. Uh...I'm thinking of going to Mars. Anybody know if the space shuttle can be modified to take me there?
    Or should I assemble my own spaceship?
    How easy is it to find the parts for assembling a rocket at the local hardware store? Anybody know if that's the best 'path' for me to take?

    Thanks!
     
  3. ecoscien

    ecoscien

    Risktaker,

    It doesn't appear to me that doing automated trading is like going to Mars. Lots of people are doing it and lots of software venders seem to be selling software that claim can do that.

    I would appreciate if someone on this forum who have had real experiences developing automated trading algorithms (there must be some, right?) can give me some advice on this.

    Thanks a lot!
     
  4. cosine

    cosine

    For numerical computing, you should look at Matlab. A cheaper, less functional but still useful alternative:

    http://www.octave.org/

    "GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language."

    "It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages."

    As for order execution, most brokers support FIX. You should look at:

    http://www.quickfixengine.org/

    "QuickFIX is a full-featured open source FIX engine, currently compatible with the FIX 4.0-4.4 spec. It runs on Windows, Linux, Solaris, FreeBSD and Mac OS X. API's are available for C++, Java, .NET, and Python."

    It really all depends on what kind of strategy you want to execute. You can continuously feed a database with prices, have octave wait for your trading algorithm on a pipeline to be given computing orders based on the database content, perform its computations, and pass the results back to your trading algorithm for decision making. I dont know much about automated trading softwares, but I believe using commercial software can remove a lot of flexility in how trade execution is tied with strategy.
     
  5. cosine

    cosine

  6. What risktaker means is that for somebody who never built a space shuttle, building an automated trading package - and make money with it - is at least as difficult.

    :D
     
  7. ecoscien

    ecoscien

    Cosine,

    Thanks a lot for the information! Wonderful stuff.

    "GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language."

    "It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages."


    As for order execution, most brokers support FIX. You should look at:

    http://www.quickfixengine.org/

    "QuickFIX is a full-featured open source FIX engine, currently compatible with the FIX 4.0-4.4 spec. It runs on Windows, Linux, Solaris, FreeBSD and Mac OS X. API's are available for C++, Java, .NET, and Python."

    It really all depends on what kind of strategy you want to execute. You can continuously feed a database with prices, have octave wait for your trading algorithm on a pipeline to be given computing orders based on the database content, perform its computations, and pass the results back to your trading algorithm for decision making. I dont know much about automated trading softwares, but I believe using commercial software can remove a lot of flexility in how trade execution is tied with strategy. [/B][/QUOTE]



    So it seems what you are saying is that I can write a trading algorithm in either C++, Java, .NET or Python, this algorithm ultimately sends orders to QuickFIX, and this algorithm also calls on Octave which can make computations and interface with a data base and any other modules I may have (even in Fortran). Have you been able to compile the trading algorithm together with octave and have used this assembly to execute any orders through direct market access?

    So what this also means is that the trading algorithm itself doesn't have to be complicated, since all the numerical computing is done through octave and the execution is done by QuickFIX?

    Please take a look at the Apama trading platform at www.progress.com
    see what you think of that. When I was thinking of modifying a commercial package I was thinking of some cheaper ones like Tradestation.

    Thanks also for the link on algorithmic trading, very interesting discussion and interesting paper.
     
  8. ecoscien

    ecoscien

    somehow my quote doen't appear the way your quotes do, first time using this...
     
  9. cosine

    cosine

    That's pretty much it, yes. Depending on how much data you use.
    First you get octave to wait on a dl-function listening on a fifo (or whatever equivalent under windows). If your trading strategy is high-frequency and does not depend on data beyond a short time frame, what you can have is your C++ algo pushing your data (wherever you got it from, tons of providers available) into octave matrices, then sending a fifo msg to octave to execute whatever computation you want from the data, and give the results back through the fifo. Given the results, you can have your algo manage your positions and fills, and send/cancel orders accordingly. No need for a database for that, you can keep that in a mmap (or whatever equivalent under windows). Also make sure you keep logs of all the orders, completed or canceled, just in case you lose your positions.

    http://www.octave.org/doc/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions <-- octave dl-functions

    If you have more data, you may need a SQL database. In that case you may want a stream feeder that stores all the order flow you're monitoring in a db. Then you have to write another dl-function for octave to read the content. Fortunately, you know what kind of data structure you deal with, so this shouldn't be much of a problem. In this case your algo will most likely iterate at some frequency and query octave to see if it finds anything new from the data, using the same method as previously described.

    There is no need to compile anything with octave. You have to compile with QuickFIX librairies, however. Octave and your trading algo both run standalone, communicating through a fifo, or whatever method you want (if you have a large infrastructure, though a socket, on different machines)
    [/QUOTE]

    Keeping track of your positions and fills is complicated enough. If your strategy is execution-dependant, all that becomes quite complex. You also have to consider risk allocation, and depending on the expected profitability of the strategy given the type of execution, put on new trades, or cancel previous ones, etc. Using both markets and GTCs, depending on how the trade should be optimally executed. Anyway, I wouldn't say it wont be complicated. However it wont be more complicated than using a commercial software, that's for sure. I can't even see how a commercial software would allow you to do that stuff.

    Ideal is when you can clearly separate the strategy from the trading (strategy does not depend on execution). Then you can manage the strategy and the execution as two separate processes, and you estimate the viability of the strategy given an expected vwap for the trade.

    Can't find it. But I'm sure it wont worth it.
     
  10. mrtwo

    mrtwo

    I would say that building your own is the way to go ecoscien and I highly recommend C++ for the task. As how complicated would it be, it is hard to say.

    It depends on what are you trying to accomplish. If you just want to get a monolithic rule based system going, it would be quite simple. If you would want to mess with AI it could get quite complicated.

    Maybe if you could elaborate a little bit more on it, I could give you a few pointers.

    Peace,
    mrtwo
     
    #10     Dec 30, 2005