Machine learning based Forex algo

Discussion in 'Automated Trading' started by gkouro, Mar 23, 2019.

  1. gkouro

    gkouro

    Hi all. I have a machine learning model that gives nice predictions. I had an ea developed only for backtesting that takes into account the predictions and the return is very good.
    Now I want to go live.
    How do I run python code every weekend and then every hour taking data from broker and then giving back data to the trading bit to make decisions?
    I can't get it around my head.
    I haven't found a platform that does both ml and trading and I don't know how to schedule python code
    Anyone who has experience in developing such algos?
     
  2. Snuskpelle

    Snuskpelle

    E.g. QuantConnect supports many Python ML libs and has a fast way of getting live trading Python code. I only mention this one because it's a platform I'm familiar with myself, not because it's necessarily the best one.

    The obvious alternative is "do it yourself" which most probably involves writing execution platform. This is a lot of work and not necessarily an optimal use of time.

    My advice is to take the shortcut by using an existing platform first, then switch to own solution once you know what you need. It's easy spending years of your life writing code you never will come to use in this business. You have definitely done the right thing by developing a model/strategy first (just make sure you realistically backtested it...)
     
    Last edited: Mar 23, 2019
  3. gkouro

    gkouro

    I have spent quite some time on quantconnect. The problem is that it doesn't behave like Metatrader 4. I want to open buy and sell trades at the same time with leverage, but it only buys and sells currency one trade at a time. It doesn't keep the trade open. Do you know a workaround?
     
  4. Snuskpelle

    Snuskpelle

    Yeah, their account model matches that of Interactive Brokers, with other target brokers mapping to their model less well. If you target Oanda for instance a MarketOrder will actually create an open trade AFAIK, but basically be hidden away for you under the IB-like layer...

    The "workaround" in case of IB is pretty easy since you can achieve pretty much the same things as with a broker with open orders (you might need to write some emulation logic). The bigger issues come if you use e.g. Oanda where the poor mapping causes not so intuitive behavior, meaning you need to study what happens on a practice account.
     
  5. Jack1991

    Jack1991

    I read a very good book by Michael Halls-Moore titled Successful Algorithmic Trading. In the book they walk the reader through an implementation of an events based backtester.

    I know a few funds that used that book to kick start their infrastructure. Worth a read.

    Link: https://www.quantstart.com/successful-algorithmic-trading-ebook
     
    gkouro likes this.