how to code my own system from scratch ?

Discussion in 'Automated Trading' started by gayaku, Jan 10, 2010.

  1. gayaku



    I would like to code my own automated trading system from scratch, using Interactive Brokers API, but without reinventing the wheel.

    I am a software developer, I have already tried retail software, and now I want to build my own platform, probably in Java or C#.

    Is anybody aware of a sort of open-source trading platform that could help me to start ? Something very basic.

    I looked a JSystemTrader and JBookTrader, it seems too evolved for what I need, and some design choices will make my task difficult (for example
    "it's not designed to check hundreds of different securities and select the ones that satisfy some criteria")

    I'd like to find some sample code for low-level things, such as:
    - receive an event when a price is updated (new bar, new tick...)
    - send orders to the market (market and limit order)
    - set stop loss and take profit order
    - receive an event when my order is filled

    I'd like something very generic/open so I can add whatever I want on top of these low levels features.

    Any help welcome,
    Thanks !
  2. Bowgett


  3. I think you could do all that with IB and Sierra Chart
  4. Hi gayaku,

    so as you I also developed my own Trading application. But as all developments it took much longer than expected. I did all things myself, Charting, Level2, Quotes, Trading, Watchlist, Tickers and so on. But there are some - for me - very important reasons to develop them my own. If something went wrong I know where to search since I understand hoe think works. The other important reason is that I could compile it for any target-system I like since I have all sources. So native 64-bit is not an issue. One of the main problem to get a realistic idea of the time needed for development is that you underestimate the things that may not work as expected. So place an order is fine. But what happened if this order is rejected, the internet connection is interrupted, the connected to the TWS is interrupted or the user changed one of your strategy-order, maybe the limit or the size, or he cancels this order? The list is very long to handle all things that could went wrong and most of them are worth to take care of, if you want to run you app with real money.

    For you requirement what the sample should show like receiving events and places order I would recommend to have a look at the IB-API. It comes - as far as I know - with some Java and also C# samples. Not really for copy and paste into your app, but a good sample to learn how things work with IB.

  5. byteme


    The IB TWS API is already at the level you are looking for. It's just a matter of using it. Did you want code that shows you how to use the API?

    The sample application that comes with the API covers implementation for most of the above.

    Anymore high-level than that and you are already looking at things like JSystemTrader that you have already dismissed as being too evolved.

    There's a lot of code samples in the IB TWS Yahoo! Group.

    Perhaps try Googling: JOpenATS

    Writing your own platform necessitates re-inventing the wheel.
  6. gayaku


    Thanks everybody for your answers, it's really helpful, I will have a serious look at everything you advised, TradeLink, JOpenATS... And also look at JSystemTrader in more details.

    My feeling so far is that the IB API and their sample code are very low-level and "raw", and requires a huge work to code a basic strategy from scratch, but other platforms like JSystemTrader have taken some decisions that may not be compatible with what I want to do in the future.

    Thanks again,
  7. edbar


    join the yahoo group calls TWSAPI and you can get sample programs to start with.

  8. gayaku


  9. edbar


    The age of the files does not matter. The samples are still valid.

    I have been programming with the TWS API since 2004.
    Though my program has changed a lot since then, the API has not changed that much.

    #10     Jan 15, 2010