Best algo trade platform for Interactive Broker?

Over the years I encountered some weird things and unexpected behavior, forcing me to adapt my code to make it sturdier. By now I believe that I've "seen it all" as I hardly ever need to modify my code anymore.

are/were those weird things and unexpected behaviours fatal (ie can potentially wreck pl) ? or connection-related?
 
are/were those weird things and unexpected behaviours fatal (ie can potentially wreck pl) ? or connection-related?
One thing I learned is to build in extra checks and verifications. The longer an undesired situation exists, the more impact it potentially can have on your P&L. This depends of course on the speed of your trading versus the duration of the malfunction.
I have seen cases where the connection to IB suddenly got lost and did not recover. You need to consider how your system should proceed if connection cannot be established (or is lost). I have seen cases where the data returned from IB deviated in format from what was expected. You have to program such that an unexpected data format will not crash your program. And have a strategy on how to proceed if you do get unexpected data. Then you have to take care of trading holidays, and don't forget about half-day trading, which happens occasionally. Sometimes the instrument identifier (conid) suddenly changes (e.g. if a stock moves from one exchange to another) and you don't receive any data on it. Or if a stock exchange suddenly halts trading due to a typhoon. And so on, and so on.
 
One thing I learned is to build in extra checks and verifications. The longer an undesired situation exists, the more impact it potentially can have on your P&L. This depends of course on the speed of your trading versus the duration of the malfunction.
I have seen cases where the connection to IB suddenly got lost and did not recover. You need to consider how your system should proceed if connection cannot be established (or is lost). I have seen cases where the data returned from IB deviated in format from what was expected. You have to program such that an unexpected data format will not crash your program. And have a strategy on how to proceed if you do get unexpected data. Then you have to take care of trading holidays, and don't forget about half-day trading, which happens occasionally. Sometimes the instrument identifier (conid) suddenly changes (e.g. if a stock moves from one exchange to another) and you don't receive any data on it. Or if a stock exchange suddenly halts trading due to a typhoon. And so on, and so on.

Thanks for the headsup. The connection loss seems rather fatal..how is it possible to trade if your connection can be suddenly lost forever. I am planning to spend next year to code some stat trading (mostly pairs) and losing connection whilst legging in will be damaging.
 
Hi, What automated trading platform do you recommend for IB?

- will implement my trading strategy
- programming language C#

Thanks,

I implemented a fully automated trading platform about 6 years ago in Java using the IB API and R code for backtesting. Have been using it until about 3 months ago when I switched to AmiBroker and Alera Portfolio Manager. It requires a lot less maintenance and I can backtest and deploy my strategies quicker. Hope this helps.
 
well, every platform has their advantages and disadvantages... it all depends on what you are planning to trade. Some things to consider:
  • portfolios: if you are planning to trade only a single instrument, or a basket where the instruments are totally independent, most platforms will do. If you are planning to trade a portfolio, with an overarching money-management, only few platforms will make this enjoyable.
  • account types: if you are planning to trade only a single account, you will probably be ok whenever the box says it supports IB. If you are planning to trade multiple accounts as a money-manager, things look sad.
  • trading types: if you need fully automated trading, you will need a platform that can interface with IB. However, if you are trading only once per day, you might have more options. In this case you would only need to have access to IB's account status, and could then write out a basket file, which you import into TWS' Basket Trader with just two mouse clicks.
  • reports: most platforms will create some report for you. However, if you need fully configurable reports, with specialized metrics, and additional plots, choices are slim.
  • data sources: every platform will connect with some data source, but maybe not the one that you would like to use. Data are crucial, and many data sources are not properly adjusted for dividends, which makes them unusuable for strategies running across dividend cycles.
I am the maintainer of TuringTrader, which is an open-source backtesting engine written in C#. I wrote this, because of my specific needs which MultiCharts, NinjaTrader, QuantConnect and some others did not address. I am using this platform for all of the model portfolios I run for my firm, submitting several thousand orders per year... using the basket file method outlined above.


Cheers, Felix

The platform looks really interesting. I am using Alera Portfolio Manager for execution as I have to send hundreds of orders per day to the market. I think it will be fairly easy to generate the signals for APM. Do you happen to have some sample code for the integration with APM?
 
I implemented a fully automated trading platform about 6 years ago in Java using the IB API and R code for backtesting.

Which asset class? Command line codes? Mind sharing some of the Java source codes, especially the parts dealing with connection, data, etc, not looking to copy any strategy or anything
 
Which asset class? Command line codes? Mind sharing some of the Java source codes, especially the parts dealing with connection, data, etc, not looking to copy any strategy or anything

I have been using the IB API mostly for stocks and occasionally for options and futures. As other have stated it’s not the easiest API to use (nor modern) and it changes quite often (more so in the past couple of years) thus the code has to be maintained quite often. If you’re interested in some code samples you can send me a private message with your contact info and I’ll get in touch.
 
I have been using the IB API mostly for stocks and occasionally for options and futures. As other have stated it’s not the easiest API to use (nor modern) and it changes quite often (more so in the past couple of years) thus the code has to be maintained quite often.
Sorry, am I right, that using IB API, one still have to trade via TWS because there is no direct connection to IB trading server?
 
Last edited:
Hi, What automated trading platform do you recommend for IB?
- will implement my trading strategy
- programming language C#

As for me:
NinjaTrader - lot's of features and well developed ecosystem.
Tradematic Trader - simple and user-friendly, you can create strategies without programming in visual strategy builder. C# code editor is also available. Quite low price.
 
Sorry, am I right, that using IB API, one still have to trade via TWS because there is no direct connection to IB trading server?

You are correct. I use the IB Gateway to connect to the IB Server instead of TWS. It's lightweight and supports the same API functions as TWS.
 
Back
Top