Python Trading System Deployment

Discussion in 'App Development' started by R100, Feb 2, 2017.

  1. R100

    R100

    There are many threads about modeling in python and using IB API for trading, i'm exploring other solutions to benefit from different trading platforms. What is the recommend method to deploy a trading system coded in python for trading futures apart from IB? the model use machine learning algorithms and other custom indicators to calculate trading signals (only 3 - 4 instruments) :

    1- Using python functions for model calculation and integrate it via TT API (X_TRADER) for live trading.

    2- Converting the developed models (including trained machine learning algorithms) from python to C# then use them as custom indicators under Ninjatrader for an automated strategy?

    3- Convert the models to DLL library then call it from Ninjatrader / Multiucharts .NET platforms.

    The frequency of trading is 1 min period or longer and tick data are used to calculate custom indicators. Best solution is the one that has the advantage of execution speed, risk management and the ability to deploy new "python" models quickly either directly or after conversion. Thank you.
     
  2. With that frequency I'd look at python talking to a FIX API which has the advantage of working over multiple brokers. All the other solutions look to have much duck tape code involved which will slow things down or introduce errors or just break at critical moments.

    Having said that I'm not familiar with any of the platforms mentioned so others might be able to chip in with more specific advice.

    GAT
     
  3. BigTommy

    BigTommy

    I'm working on a python trading system too. I'm starting with only doing EOD trading, which I think is much less risky. You might want to do the same, rather than diving in with both feet. I don't think it makes sense to fully automate it until you've already proven that it actually works.

    I'm using Tulipy Indicators for technical analysis, and then trying different machine-learning models on those. So far it's going well.
     
  4. I've written some trading systems in C++ that can run on both IB and Oanda. It took some work but I created a generic trading adapter class that is implemented as derived classes, one for IB, one for Oanda. The trading systems see a single interface but can trade on either platform under the hood.
    You could do the same thing in Python no problem (just some work).
     
  5. 2rosy

    2rosy

    you could write an "order gateway" (basically a router/proxy) in c#,java,c++ or similar that connects to your broker and places orders, gets data and executions. Have the gateway accept internal orders from python or anything which it then forwards on to the broker and sends back executions to the source system.
     
  6. yabz

    yabz

    I have developed an automated trading system in python using the oanda api which is fairly straightforward. I'm slowly putting together a blog which documents how it works. The advantage of oanda for currency trading is the number of pairs it allows compared to IB. Algorithmic trading works well with a large number of instruments...
     
  7. Like we really need yet another 'trading with python 101' type monetized blog...
     
  8. xandman

    xandman


    Actually, his timing is perfect. It will capitalizes on the demise of FXCM US.

    Any good dotnet/C# ones with OANDA?
     
  9. yabz

    yabz

    If you found programming with oanda's API Rest-V20 easy using the available documentation you are a lot smarter than I am. Much of the documentation refers to the Rest API and has not been updated to V20 which adds to the confusion. Its taken me a while to figure it out and I'm happy to pass that on if anyone finds it helpful. I'm still struggling with some of it....